home *** CD-ROM | disk | FTP | other *** search
/ Risc World Words - Complete RISC World 1 to 6 / Risc World Words - Complete RISC World 1 to 6.iso / HTML / VOLUME3 / ISSUE4 / TEXT < prev   
Text File  |  2006-03-20  |  203KB  |  2,180 lines

  1.  
  2. ÿÿÿÿVOLUME3/ISSUE4/AGRM/INDEX.HTM Volume 3, Issue 4, The Archimedes Gamemakers Manual
  3.  
  4.  
  5.  
  6. The Archimedes Gamemakers Manual
  7. Copyright © APDL and Terry Blunt 2002. All Rights Reserved
  8. The Archimedes Gamemakers Manual is © Terry Blunt and Sigma Press. This edition also © APDL. All rights reserved. No part of this publication may be reproduced or transmitted in any form or by any means without the prior written consent of the Publisher nor circulated in any form, binding or cover other than that in which it is published and without a similar condition being imposed on the subsequent purchaser. 
  9. Published by -
  10.             APDL
  11.             39 Knighton Park Road
  12.             Sydenham
  13.             London  SE26 5RN 
  14.             Phone:  020 8778 2659
  15.             web:  www.apdl.co.uk
  16. Part 2 - Contents
  17. Chapter 4 - Static Graphics
  18. 4.1 Drawn Pictures
  19. 4.2 Sprites
  20.  
  21.  4.2.1 User Sprites
  22.  4.2.2 Sprite Masking
  23.  4.2.3 Sprite Control
  24.  4.2.4 A Sprite Example
  25.  
  26. 4.3 User Defined Characters
  27. 4.4 ECF Patterns
  28. 4.5 Backgrounds
  29. 4.6 Banked Screens
  30. 4.7 Clearing Screen Areas
  31. 4.8 Smartening Up
  32. 4.9 Fancy Fonts
  33. Chapter 5 - Making it Move
  34. 5.1 Objects
  35. 5.2 Movement
  36. 5.3 Animation
  37.  
  38.  5.3.1 Colour Changing
  39.  5.3.2 Animating Sprites
  40.  
  41. 5.4 Collisions
  42.  
  43.  5.4.1 Coordinate Collisions
  44.  5.4.2 Pixel Collisions
  45.  5.4.3 Cell Collisions
  46.  5.4.4 Pointer Collisions
  47.  5.4.5 Look Ahead
  48.  
  49. 5.5 Scrolling
  50.  
  51.  5.5.1 Hardware Scrolling
  52.  5.5.2 Scrolling in Software
  53.  5.5.3 ARM Code Scrolling
  54.  
  55. Chapter 6 - More Dimensions
  56. 6.1 3D
  57.  
  58.  6.1.1 Cartoon Styles
  59.  6.1.2 Scaling
  60.  6.1.3 Perspective
  61.  6.1.4 Wire Frame Drawings
  62.  6.1.5 Hidden Lines
  63.  6.1.6 Rotation
  64.  6.1.7 Matrices
  65.  6.1.8 Universal Movement and Rotation
  66.  
  67. 6.2 Sound
  68.  
  69.  6.2.1 Music
  70.  6.2.2 More Voices
  71.  6.2.3 Voice Generator Utility
  72.  
  73.  
  74. Terry Blunt
  75.  
  76. ÿÿÿÿVOLUME3/ISSUE4/DISC/INDEX.HTM Volume 3, Issue 4, DiscWorld
  77.  
  78.  
  79.  
  80. DiscWorld
  81. Aaron Timbrell dives into the software directory.
  82. It's yet another packed DiscWorld this issue (well you better unpack it before it gets sent out - HJ) with our usual number of goodies.
  83. Emotions
  84. This month the full commercial offering is the classic platformer from GEK, Emotions. Full instructions for playing Emotions are inside the program, and are reproduced as an article in this issue. You can access the in-game instructions from the screen headed PLAY, from here you can set the a number of options including the keys used. The default keys are:
  85.   Left                    
  86.   Right                   
  87.   Up/Jump                 
  88.   Down/Pickup             
  89.   Fire/Drop forward       RETUR
  90.   Dynamite                SPAC
  91.   Pause                   F
  92.   Skip Intro/Suicide      ESCAP
  93.  
  94. Zap
  95. After many years of waiting we finally have a new stable release of Zap. The long changelog shows the amount of work the Zap developers have put into this essential package. Below we are reproducing chapter 2 of the Zap manual, the Installation guide.
  96. Zap Manual - Chapter 2: Installation
  97.  
  98. Zap is a fairly complex application, and while you _can_ just copy it onto your hard disc, it is better if you set it up properly. This will only take a couple of minutes, and has a number of benefits (although in general you won't notice them directly - you just won't get irritated by some of the things that can go wrong if you _don't_ set it up properly).
  99. See section 2.4 if you are upgrading from Zap v1.40 or later.
  100. Unfortunately there is no simple upgrade path from earlier versions of Zap, because both the configuration and the layout of files within Zap itself have altered. We apologise for the inconvenience this causes.
  101. 2.1 Getting the right files.
  102. Zap comes in a number of parts. Which parts you need will depend on what you're intending to do.
  103. Firstly there is the core distribution, which contains merely those files _required_ to get Zap running. While this will give you a usable text editor, it will be missing many of the more sophisticated features described in this manual.
  104. Secondly there is a group of extensions which is _recommended_;
  105. you don't need these to run Zap, but they provide lots of useful features which you will probably want.
  106. Thirdly, there are some _optional_ extensions which many people won't need, but which some people will find useful.
  107. The core distribution is supplied in one archive, the name of which will depend on which version you decided to download. There are three core packages:
  108. zap.zip. This is the smallest archive, containing just the files needed to get Zap running.
  109. intl.zip. As above, but adds French and German translations.
  110. devel.zip. As above, but adds some tools which may be useful to authors of Zap extension modes.
  111. This is the first thing you should set up; this process is described below in section 2.2.
  112. There are a number of extension modes which you may also have downloaded - once you've set up Zap itself, you can install these; see section 2.3 below.
  113. The following additional archives are optional:
  114. zfonts.zip - a full ZapFonts distribution, containing lots and lots of fonts. Generally you don't need this for Zap, since the core archive comes with a minimal ZapFonts distribution; however ZapFonts is used by some other applications, so you may want the additional fonts for use with them. See section 2.2.2 below for more information.
  115. 2.2 Core setup.
  116. The Zap core distribution contains an Install file (this document in text format), the !Zap, !ZapFonts and !ZapUser application directories, and a couple of other utilities. Please don't just copy it onto your hard disc - this is extremely limiting.
  117. Let's look at where they should be going. We'll deal with ZapUser first.
  118. 2.2.1 ZapUser: user configuration files.
  119. ZapUser is designed to keep all your preferences and settings in one place. This means that you can copy it onto a floppy disc, take it to another computer, and have exactly the settings that you want there too.
  120. If you have a RISC PC-style boot structure (as most people do - see below if you don't), then you want to put ZapUser in Boot:Choices (Shift double-click on !Boot on your main hard disc, and then double-click on Choices in the directory viewer that come up; then you can move the !ZapUser application by Shift dragging).
  121. If you _don't_ have a RISC PC-style boot structure, then you have a choice. If you have a boot structure then you can try to find a place to put ZapUser in that, so that it will get booted _before_ Zap (wherever you put Zap). If you can't do that, or don't know what it means, then it's best to put ZapUser inside Zap, as !Zap.!ZapUser. While that's far from ideal, it's a lot easier than setting up a boot structure just to deal with ZapUser.
  122. You can use ZapUser to have multiple configurations on one machine.
  123. To change from one to another, just double-click on the ZapUser you want to use, and then quit and restart Zap. A range of sample configurations should be available from wherever you obtained Zap - see section 15.2.
  124. 2.2.2 ZapFonts: the global bitmap font resource.
  125. ZapFonts is the global bitmap font resource; it is to bitmap fonts what !Fonts is to outline fonts. Zap uses bitmap fonts in all its file windows, and several other applications also use it, including _Messenger_ and _FreeTerm_. Consequently we want it to be somewhere that they can all get at it.
  126. If you have a RISC PC-style boot structure, then you want to put ZapFonts in Boot:Resources. If you don't have a RISC PC-style boot structure, then you need to find another place to put ZapFonts so that it will boot before Zap. If you absolutely can't do this, then you should put ZapFonts inside the !Zap directory as !Zap.!ZapFonts, and make sure that Zap boots before anything else which might need ZapFonts. The best way to do this is to have Zap in the root directory of your main hard disc; however we strongly suggest that you use a boot structure of some sort - there are a number of free ones available which should suffice.
  127. Because ZapFonts supplies all the bitmap fonts for all the applications that want to use it, the complete distribution is fairly large. Consequently the version in the core Zap distribution is minimal, containing only a couple of fonts. The complete set is available from wherever you got Zap from (see section 15.2); it will come as a !ZapFonts application directory which you can simply copy it over the top of your installed !ZapFonts directory. You may need to restart some applications to get them to recognise the new fonts (this isn't true of Zap, which will recognise automatically that you have installed new fonts).
  128. For more information on using ZapFonts, please see the documentation supplied inside its application directory.
  129. 2.2.3 Support files.
  130. Zap comes with some additional support files, !Country, !!DeepKeys and DDEU_Patch which you'll want to deal with when you're setting it up.
  131. It also comes with an Obey file, DontRun, which is supplied to assist upgrading configuration from v1.40 to v1.45 - see section 2.4 for more information.
  132. 2.2.3.1 !Country.
  133. !Country is a small utility that you should run at startup which determines the country you've set your computer up for. Ideally you should place it in Boot:Choices.Boot.PreDesk on a recent boot system, so it will be run before anything else, and indeed it is supplied inside a !Boot structure that you can copy over your current one. !Country sets the environment variable `Sys$Country' to whatever your current country is. Zap uses this in its internationalisation support (see section 12.4).
  134. 2.2.3.2 !!DeepKeys.
  135. !!DeepKeys is a utility that should be run at startup which tries to stop RISC OS from losing modifier keys (such as Shift, Ctrl etc.).
  136. As for !Country, it should live in Boot:Choices.Boot.PreDesk, and is also supplied inside a !Boot structure to make this easier.
  137. 2.2.3.3 DDEU_Patch.
  138. DDEU_Patch patches DDEUtils so that Zap can read the current prefix directory for a taskwindow. You should only run it if you're using version 1.53, 1.54 or 1.55 of DDEUtils. Versions later than 1.55 do not need to be patched since they already include the necessary code.
  139. To check which version you have:
  140.     *Help DDEUtils
  141. If this reports "No help found", then:
  142.     *Load System:Modules.DDEUtil
  143.     *Help DDEUtil
  144.  
  145. Version 1.54 is supplied in the standard !Boot, and version 1.59 is the first version to be included in ROM.
  146. 2.3 Extensions setup.
  147. Any extension archive you downloaded will contain a directory !Zap which should be copied over !Zap.
  148. Alternatively, you can install just some of the extensions. If you are fairly confident, you can do this yourself by simply copying the relevant applications _from_ the !Zap.Modules directory of the archive _into_ !Zap.Modules in your installed setup.
  149. You will then need to quit and restart Zap to complete the setup.
  150. 2.4 Upgrading from Zap v1.40 or later.
  151. To upgrade from Zap v1.40 or later, you need to do three things.
  152. Replace !Zap - see section 2.4.1
  153. Upgrade !ZapFonts - see section 2.4.2
  154. Upgrade !ZapUser - see section 2.4.3
  155. 2.4.1 Replacing !Zap.
  156. Since all configuration is now held in !ZapUser, there is almost nothing which most people need to alter inside !Zap itself these days - including the extensions. This means that you should simply be able to replace your current !Zap application directory with a new one constructed from the core archive and whatever extensions you need, as explained earlier. Please _don't_ copy the new !Zap application over your old one since that will cause problems as some files have been replaced by directories - delete your existing !Zap first.
  157. Note that this won't work smoothly if you have been keeping !ZapFonts or !ZapUser inside the !Zap application directory. If you are doing so, please consider trying to find an alternative solution, because it will make your life much easier.
  158. 2.4.2 Upgrading !ZapFonts.
  159. The only change in !ZapFonts since Zap v1.40 was released is a new version of the ZapRedraw module. You should copy the new one from inside !ZapFonts in the core archive into your working !ZapFonts application directory. Alternatively, simply copy the new !ZapFonts over your old one.
  160. 2.4.3 Upgrading !ZapUser.
  161. The changes to upgrade your configuration from Zap v1.40 to Zap v1.45 are involved, however two facilities are available to assist the process:
  162. If you have Perl, you can download a script that will do the majority of the work for you - this is available from http://zap.tartarus.org/ftp/pub/1.45/upgrade-config.pl.
  163. The Zap developers are providing an upgrade service - package your !ZapUser into a Zipfile and send it via email to upgrade@zap.tartarus.org. One of the developers will upgrade your configuration for you and return it to you.
  164. If you want to upgrade your configuration yourself, the following changes need to be made. All the files referred to below are in !ZapUser.Config.
  165. If you are upgrading from Zap v1.42 or later, some of these changes may be unnecessary for you.
  166. !ZapBoot has changed substantially; it is suggested that you copy the new version over and make any changes you need. In practice, you are unlikely to have changed anything, except perhaps the file type claims (lines such as ZapRunType FFF).
  167. !ZapRun has changed substantially to support internationalisation;
  168. it is suggested that you copy the new version over and make any changes you need. In practice, the only parts you are likely to have changed are the templates set, and perhaps the file type claims.
  169. Note that some template sets haven't been updated for v1.45, and so aren't supplied any more. In addition, note that the old system variables `Zap$HelpPath_<mode>' are no longer required.
  170. Country has been added to support internationalisation; it can be used to override your system country. You should copy this file over, but only edit it if you need to set your country explicitly.
  171. Settings has had two variables added. &322 can be used to specify a command to execute on startup, and &323 specifies the default mode.
  172. See section 12.3.1 for more information.
  173. A directory TMFs has been added. You should copy this across. TMFs (Textual Mode Files) are files that set per-mode variables, used to make some commands and operations more configurable. (See section 12.3.6 for more information.) If you are upgrading from v1.42 or later, you will already have this directory present; however it may contain TMFs which are now unnecessary. Unless you have edited any of these yourself, you should only have TMFs for core modes (Text, Byte, HalfWord, Word, DoubleWord, ASCII and Code) in this directory.
  174. Two new files, FileIdHigh and FileIdLow, have been added. These should be copied across. They allow modes to be selected on loading files based on the contents of the start of the file.
  175. The Keys file has changed significantly; firstly, the method of specifying alternate keymaps has changed from using &400 variables in a block, to using &800 variables immediately before the keymap in question, to declare them. Secondly, support for country-specific Keys files has been added; instead of a single file, you should have a directory, ZapUser:Config.Keys, containing a file for each country (eg: ZapUser:Config.Keys.UK, ZapUser:Config.Keys.France).
  176. Unless you made significant alterations to your keys file, we suggest that you copy in the new Keys directory and make any changes you need. Alternatively, move your current ZapUser:Config.Keys to ZapUser:Config.Keys.UK (or another country name, as appropriate), and edit it to use the new file format. See section 12.4 for more information about internationalisation, and section 12.3.3 for more information about the new Keys file format.
  177. Also, some extension modules have their own Keys files. They may also be configured to use their keymaps by default; you can override this by altering the relevant module's TMF file (see section 12.3.6 for more information).
  178. The Menus file has also become internationalised, in the same way. In addition, we now generate menus files from a source format which allows you to name menus instead of referring to them by number. Further, areas of the source file can be made optional - the idea is that more or less everyone can use the same source file, while still being able to configure things a fair amount. We strongly suggest that, if you don't like the new default menus, you copy the new menus directory, look at, and possibly edit, the appropriate source file (they are supplied in the directory ZapUser:Config.Menus.Source), and generate your menus file from that. See section 12.4 for more information about internationalisation, and section 12.3.5 for more information about the new Menus source format, and the method for generating the final file from source.
  179. Now you have a working version of Zap. If you currently have an older version of Zap running, you should quit it; now you should double-click on both ZapUser and ZapFonts to make sure that they are setup correctly in their new locations. Finally you can double-click on Zap to load it.
  180. The complete DiscWorld line up
  181. So to sum up this issues DiscWorld looks like this...
  182. Emotions
  183. The full commercial game from GEK Programs.
  184. Games
  185. The complete SDL (Simple DirectMedia Layer) package from EQ Labs, along with some sample games. Also the latest demo version of Vingt et Un from Ian Mcfarlane.
  186. MakeHTML
  187. Following on from last issue, we have HTML converters for the Impression family.
  188. Modules
  189. All the source code and the executables, from Brian Pickard's series.
  190. PD
  191. All the latest PD, shareware and freeware releases from the PD column. This issue we focus on one author, Jochen Lueg
  192. PowerBase
  193. The latest version of PowerBase and the example files discussed in Derek Haslam's article.
  194. ReadARGS
  195. The sample program discussed in Hariet Bazley's article.
  196. Zap
  197. The latest version of !Zap (the first in over two years).
  198. Aaron Timbrell
  199.  
  200. ÿÿÿÿVOLUME3/ISSUE4/EDITOR/INDEX.HTM Volume 3, Issue 4, Editors Corner
  201.  
  202.  
  203.  
  204.  
  205. Editors Corner
  206. Aaron Timbrells own bit of the magazine.
  207. Phew, what a couple of months it's been. We have another cracking issue this time (in my opinion). Still, enough about RISC World it's a very exciting time at the moment. One of the most interesting things going on is the sudden interest in RISC OS programming. We have seen a number of new versions of existing applications popping up out of the woodwork. For example, a new version of Zap has just been released and it's in the software directory of this very issue. Many of these new releases are 32 bit compliant, which means of course that they will run on a 32 bit version of RISC OS, such as that found in the new Iyonix PC announced by Castle a short time before the Acorn Southeast show. For more details on the Iyonix see this issues Insider article. Castle have also released a 32 bit C compiler which seems to have kick started a new round of application development. This can only be a good thing for the market. Many of these new releases will be covered in next issue's PD column once Paul Brett has recovered from the amount of software he has been receiving! Also you can expect some very surprising announcements coming in the next issue.
  208. We are short of a couple of regular columns this issue. Due to pressing deadlines the issue had to go to bed early (and it's been grounded and lost its pocket money too -HJ). So the Education Column and Paul Johnsons development of his football manager game will be back with us next time.
  209. I will sign this bit off with a small warning. This is the last issue of RISC World (Hurray - HJ), wait for it, that will be on 74 minute CDs. We simply can't obtain them anymore, so RISC World will be moving to 80 minute CDs from the next issue. So if you have an old two speed CD-ROM drive, such as a Cumana, and you can't read the next RISC World then it may well be time to throw the drive away and spend £24 inclusive of VAT on a 52 speed drive and the driver software. If you don't believe that is what a CD-ROM drive costs why not check out the 
  210. Editors Rant of the month
  211. I only have one rant this month, my old Eizo F550i monitor. This 17" beauty was purchased from Atomwide in early 1995, but was already a couple of years old. The princely sum of £450 was handed over for a very nice, well built monitor. At first it was attached to my ancient A310 (with a ColourCard), then moved to an A5000, and then finally ended up on the main RiscPC in my office. It was used every day, sometimes for up to 18 hours at a stint. It got taken to shows all over the country. It was used while I was writing most versions of DrawWorks, in fact over 30 commercial applications, and a host of other apps, were written in front of this monitor. When I passed iSV Products over to APDL the Eizo still soldiered on, RISC World was assembled in front of it, as was the VirtualAcorn website. And then two weeks ago it started playing up. The picture went very bright, and shrunk to three quarters of its normal size. I turned the monitor off and left it to cool down. Then it was fine for a couple of days, then it did it again. Power off, wait, power on. The screen was now fine again then an hour or so later it went phut, well I say phut, more sort of tshscsczzzzzzzzz....pfhup. No picture and a nice scented burnt out monitor smell in the office. I mean this simply isn't on. I paid £450 for a monitor that only lasted seven and a half years (or 390 weeks). Ok it wasn't used all the time, but lets say it was on 8 hours a day for 5 days of the week, that would be 40 hours a week. So in total it was probably used for 15,600 hours. Since it cost £450 in the first place it therefore cost 2 pence per hour. If we assume 2p per hour for the next monitor then it will have to last 2 years, which is why paying £85 for a branded 21" monitor with a guarantee isn't too bad an idea. Actually come to think of it what am I ranting about?
  212. Printing RISC World
  213. The new look of RISC World means that when you want to print an article on your printer it will have the light yellow background. However most web browsers allow you to turn off the background images when printing. The example below shows the print dialogue box from Fresco.
  214.  
  215. As you can see the option "No Background" is ticked. If you want to print out any of the RISC World pages then make sure you have clicked a similar option in your browser.
  216. Aaron Timbrell
  217.  
  218.  
  219.  
  220. ÿÿÿÿVOLUME3/ISSUE4/EMOTIONS/INDEX.HTM Volume 3, Issue 4, Emotions
  221.  
  222.  
  223.  
  224. Emotions
  225. Emotions - a simple players guide
  226. Welcome to Emotions. 
  227.  
  228. You take control of HenkyPenky, who is searching for Emotions. Emotions is a platform game, so you'll have to jump your way to freedom. There are lots of bonus Emotions to acquire. Like all good Acorn products, this game supports drag n' drop. This works on things like boxes and packages. You can stack them, so you can reach even higher platforms. Actually, there are two ways to drop objects. You can drop it at your feet, or in front of you. The coolest thing in the game is dynamite. Now you can really mess things up!! It only works with soft walls like sand.... and of course monsters. One of the other cool things are the weapons (machineguns, chainsaws, etc).
  229. The Keys
  230.  
  231. The default keys are -
  232. Left                    
  233. Right                   
  234. Up/Jump                 
  235. Down/Pickup             
  236. Fire/Drop forward       RETUR
  237. Dynamite                SPAC
  238. Pause                   F
  239. Skip Intro/Suicide      ESCAP
  240.  
  241. The Monsters
  242.  
  243. Here are the monsters from the first scenario.
  244. Flax, a Flax flies through the game area and will suck HenkyPenky into his mouth. He will drop him somewhere else, not in a positive kind of way. A poison resides in a Flaxs mouth, so it's possible to die in it. Very dangerous indeed!
  245. Paars, a Paars is a strange little monster, with little danger. But it can burn you if you are too close.
  246. Qnors, Qnors are stupid. They don't hurt you and they don't even block the way.
  247. ZLomps, Zlomps are big strong slime balls who can't walk or fly. Their only task is to duplicate Zlombas. Those Zlombas will come out of his body. Kill those busters!
  248. Zlombas - duplicated by Zlomps, they are little monsters, with poisonous skin, so don't touch them! These monsters are blind so they just fall and walk.
  249. The Preferences
  250.  
  251. The following will explain the icons in the Preferences screen. In the preferences screen, just click on one of these icons with the mouse to change an option. You can also enter the Preferences Screen during gameplay, just pause the game and give the mouse a wake-up.
  252. The music options
  253.  
  254. In the Preferences screen you can see these icons on the top-left of the screen : music on or music off. Also there are options for sound FX off, sound FX on and sound FX in stereo. The stereo mode will play all FX in stereo calculated from the centre of the screen.
  255. Changing the sound volume is very simple, the bar shows you the volume from 0 to 100%. Just click on the bar to set the volume. You can hear the volume in the background.
  256. Gore rating
  257.  
  258. You can also adjust the amount of gore with the GORE rate setter. There are six different gore rates - off, little, some, OK, yes, YES!
  259. Preferences Files
  260.  
  261. A preference file is an advanced configuration for Emotions. It contains all the possible variables or parameters that can be altered to suit your own game. Preferences files can be double-clicked upon, which will load the Emotions game in the usual way, but doing this uses this preferences file instead of the standard prefs file built into Emotions.
  262. The Preference directory contains two preferences, called "Default" and "CDMusic". The first one can be very useful if you've ruined your "Prefs" file. The second one should be used if you'd like to have an audio CD playing. The standard music will then switch off, and the music volume bar in the Preferences screen in the game will now affect CD music volume.
  263. Creating your own Preferences File
  264. Editing a preferences file is best done with !Edit or !Zap. You must then manually type in the various options and variables. A preferences file's syntax looks like this:
  265. GEKonfigJOS2
  266. ©1997 GEK Program
  267. [Audio
  268. music=<option>            where <option> is on|of
  269. musicvolume=<volume>           where <volume> is 0...100
  270. sound=<sound>                  where <sound> is off|mono|stere
  271. soundvolume=<volume>
  272. quality=<quality>              where <quality> is 24...99u
  273. (musicoption=<(-l)> <(-s)>)    where -l means Leave,-s means Shuffl
  274. (musicsize=<size>)             where <size> is in K
  275. (musicsetup=<filename>
  276. [Display
  277. display=<display>              where <display> is clear|ful
  278. blood=<blood>                  where <blood> is 0...
  279. (resolution=X<xres> Y<yres>)   where res means resolutio
  280. (blend=yes
  281. [Misc
  282. intro=<option>
  283. [Controls
  284. Left=<key>                     <key> is e.g Z or SpaceBa
  285. Right=<key>
  286. Up / Jump=<key>
  287. Down/Pickup/Drop down=<key>
  288. Fire/Press/Drop forewards=<key>
  289. Dynamite=<key>
  290. Pause=<key>
  291. Suicide/leave=<key>
  292. ***future key***=Select        not yet implemente
  293. [Hiscore
  294. <score>,<name>
  295. <score>,<name>
  296. <score>,<name>
  297. <score>,<name>
  298. <score>,<name>
  299. <score>,<name>
  300. <score>,<name>
  301. <score>,<name>
  302. <score>,<name>
  303. <score>,<name>
  304. checksum=<rate>                  <rate> is checksum for hiscor
  305. [Data]                           please do not alter this area
  306. game=Emotions                    This area is used by GEKonfig
  307. path=<Emotions$Dir>
  308.  
  309. The names between < > tokens are options or values. Values sometimes have to be followed by units like % or uS Everything between ( ) tokens is optional. This could be just a parameter or even a whole line.
  310. The Music Option
  311. Syntax : musicoption=<(-l)> <(-s)>
  312. -l : Leave, this keeps the music currently played by the QT
  313.      tracker in the desktop
  314. -s : Shuffle. This option should be set if you'd like to load 
  315.      music list with Emotions
  316.  
  317. The Music Size
  318.  Syntax : musicsize=<size>
  319. If you load a music list file with Emotions, set the music size to the amount of memory of the largest possible music file.
  320. The Music Setup
  321. Syntax : musicsetup=<filename>
  322. The name of the music list file that you'd like to load with Emotions. Emotions supports the music list files of both !RTracker and !PDTracker. This way you can have your own choice of tracker music files.
  323. The game resolution
  324. Syntax : resolution=X<xres> Y<yres>
  325. You can use any resolution you like when playing Emotions. However, any resolution but the standard is not recommended as this option is not officially supported. The chosen resolution must also appear in your Monitor Definition file.
  326. The fully blended to background fonts option
  327. Syntax : blend=yes
  328. This will tell the font manager to blend each outline font to the background as best as possible. This option is included for completion, but is (as yet) rather slow on Acorn Computers, and not really usable
  329. NOTE : Emotions can shuffle music with the Tab key during game or within the preferences screen. This works with CD Audio as well as Tracker files. If Shuffling results in the loading of a Tracker file larger than the reserved amount of memory, Emotions will go absolutely wild! You should increase the music size within the preferences file.
  330. Credits
  331.  
  332. Emotions v 1.11 is (c)1997 by GEK Programs and APDL/The Datafile.
  333. This is the registered version of Emotions, and is therefore NOT public domain nor freeware, and may not be copied or whatever.
  334. Emotions is programmed by : Jeroen M. Groenendaal Emotions Palette Routines is programmed by : Edwin F. Groenendaal Sound and music play module by : QTMModule 1.28 by Stephen Harrison Emotions -in game- artwork by : Jeroen Groenendaal Emotions introduction artwork by : Edwin Groenendaal Music by : Several PD musicians.
  335. We'd like to thank the following playtesters : Rowald Groenendaal, Eric Kalsbeek, Tim Swarthoff.
  336. Special thanks to : Eric Kalsbeek who painted two (yes two!) flowers, three (blimey!) smilies, and ideas. HeadCrash for some sound support. Tim Swarthoff for improving on playability. Stefan Leich for being Henky's voice (this is not yet included in the introduction). He still does the LADA's engine. Dave & Sue McCartney for doing things we couldn't - or didn't want to...
  337. The Datafile logo is made using Photodesk 2.
  338. The wood of the GEK Programs logo was first hand-drawn on paper, and was then scanned and coloured by Photodesk 2. The text was added at a later date, also using Photodesk 2.
  339. The Emotions logo is made in Artworks using the blend tool.
  340. The introduction of Emotions is also made with Artworks.
  341. All the graphics in Emotions (except the cars) are drawn in The Big Picture using a Tabby and scaled using ChangeFSI. The animations are made using the scaled versions. To avoid wrong anti-aliasing, all scaled graphics are made with a big outline and the background was a very dark red. The cars in On The Road are made in Artworks.
  342.  
  343. RISCWorld
  344.  
  345. ÿÿÿÿVOLUME3/ISSUE4/GAMES/INDEX.HTM Volume 3, Issue 4, Games World
  346.  
  347.  
  348.  
  349.  
  350. Games World
  351. Paul Brett with the latest gaming news.
  352. When did you last notice a large number of interesting games releases for RISC OS? There have been a few commercial releases this year, including Tek and the updated Desktop Repton, both of which have been reviewed in RISC World. However there hasn't been much to write about with regard to PD, Shareware and Freeware games releases, well that is until now.
  353. Vingt et Un - 
  354.  
  355. This is the latest (and possibly final) release of 
  356. The introductory screen
  357. As is usual the application sets its icon on the icon ba
  358. when loading is complete. When you click the Select
  359. mouse button over this icon, the game's window will be
  360. displayed. The pointer will appear within this window
  361.     
  362. A welcome message appears with the Vingt et Un logo and if
  363. you want instructions you should press the mouse
  364. Adjust button at this point OR press Select
  365. to start the game
  366.     
  367. If you choose to view the instructions, which deal with the
  368. rules of play of Vingt et Un itself, these will be
  369. presented as a series of pages which can be passed through
  370. by clicking on Select.  If you need to return to
  371. the start of the instructions, press Adjust
  372.     
  373. At the end of the instructions, press Select to
  374. start the game.  To hide the game, click on the window's
  375. close icon and to end the game choose the
  376. Quit item from the iconbar's menu
  377.     
  378.     The object of the game
  379. The idea of this card game is to reach a total of 21,
  380. without exceeding it, by counting the pips of the cards that
  381. are dealt to you. The suits do not play a part in the game.
  382.     
  383. Aces count either one or eleven at the player's option,
  384. court cards count ten, other cards their face value. A total
  385. of 21 therefore can be made with an Ace and a ten or a court
  386. card and this beats any other combination. The order of
  387. winning hands in decreasing order is:
  388.     
  389.      21 with two card
  390.      a five card tric
  391.      21 made with more than two card
  392.      2
  393.      1
  394.      1
  395.      1
  396.      16
  397. You are not allowed to 
  398. 'stick' at less than sixtee
  399.     
  400.     
  401. Betting is very much a part of the game. You are given chips
  402. at the start of the game and, by betting wisely, the object
  403. of the game is to increase that amount
  404.     
  405.     Playing the game
  406. Initially the window is cleared and the pointer will be
  407. positioned to a point where the first card will appear
  408. Several chips of various denominations will be displayed at
  409. the bottom of the window and represent the player's purse
  410. During the game the contents of the purse is always
  411. displayed in this area and the denomination of the chips is
  412. arranged such that there are a few chips of each value, so
  413. that the player can bet as he/she requires
  414.     
  415. The software is written to mimic as closely as possible the
  416. traditional card game, in that the cards are drawn randomly
  417. (shuffled) and held in a 'pack' and are dealt in this order
  418. from this pack and after play, returned to the bottom of
  419. the pack.  The pack is shuffled at the start of the game,
  420. after a player's Vingt et Un or when the cards have gone
  421. round twice
  422.     
  423. Finally two cards are displayed in the window face down. 
  424. The pointer is over the top of the lower card which is the
  425. player's first card.  The other card is the dealer's card
  426.     
  427.     
  428.      
  429.     Peeping at a card
  430. The text at the top invites you to hav
  431. a peep at your card. Move the pointer to the centre of th
  432. bottom of the card.
  433. Select is used to drag on the card in an upwards
  434. direction, in order to 'peep' at the value of the card.
  435. Part of the other face of the card, showing its value will
  436. become visible (see screenshot) and if the drag is completed,
  437. then the card will have been turned over and will remain so. 
  438. However the drag can be stopped at any time and the card will
  439. drop back to its original state with its back uppermost. 
  440.      
  441.     Betting
  442. The text at the top of the window then
  443. prompts you to bet, in the knowledge of your card's value. 
  444. Choose a chip to bet with, moving the pointer over it and then
  445. use Select to drag on this chip to be moved.The
  446. pointer will then be changed to the chip, which should be
  447. dragged to the space between the two cards and then
  448. released.Move more chips to increase your bet, but there
  449. is a limit of ten chips.The screenshot shows a chip,
  450. valued at five being moved by the player to the stake pool
  451. between the dealer's and player's cards. 
  452.     
  453.     
  454. You will find that you can change your mind about your
  455. initial stake and it is possible to move chips back to
  456. your purse, but only before you have peeped at the second
  457. card
  458.     
  459. This then is your initial stake and determines the top
  460. limit of the price you can pay for future cards in this
  461. game.  You signify your acceptance of this initial stake
  462. and moving the game on, by peeping at your second card,
  463. which will have appeared after you moved the first chip
  464. of your bet
  465.     
  466.     Turning over the second and
  467. subsequent cards
  468. After you have peeped at your second card, add the card
  469. values together and, if an Ace is present, arrive at two
  470. scores: one counting the Ace as one and the second, counting
  471. the Ace as eleven.  You have three choices:
  472.     
  473.     Stick - and see what
  474. the dealer has.
  475.  
  476. You do this by clicking Select when the pointer is
  477. over the dealer's cards.
  478.   You are allowed to stick if
  479. your cards make at least sixteen and you may count Aces as
  480. eleven. You might want to stick for a variety of reasons;
  481. here are just a few of them:-
  482.     
  483.     
  484.     If your two cards make twenty-one -
  485. Vingt et Un - then the dealer can only beat you with
  486. one of his own: this is not common
  487. The screenshot shows that the Player's Vingt et Un has been
  488. equalled by one from the dealer: the dealer takes the
  489. player's stake. 
  490.     If your two cards make twenty then there is not much
  491. chance of the dealer having 21 or 20 or a five card trick
  492. and even less that the card you receive will not 'bust' you.
  493.     If your two cards make eighteen or more then there
  494. isn't much chance of obtaining another card which will not
  495. 'bust' you (make your total greater than twenty-one)
  496.     If your two cards make sixteen or seventeen then,
  497. if you have already seen a lot of small valued cards in the
  498. last two or three hands, the chances are that there will not
  499. be many left for you to pick up in the next card to keep you
  500. under 22.
  501.     
  502.     
  503.     Buy - increase your stake and keep the dealer
  504. from knowing what your new card's value is.
  505.  
  506. You must move one or more chips to the centre, where your
  507. initial stake is, and the value of this additional stake
  508. must be less than or equal to the original stake.  Now
  509. sometimes you just haven't got the right chips to do that.
  510. Don't worry: use a higher valued chip, but your actual stake
  511. will be limited to what it should be and you will receive
  512. back the 'change' if you loose.  If you buy more cards in
  513. this hand, this 'change' will go to buying these additional
  514. cards.
  515.  
  516. You will find that you can - and should - peep at the new
  517. card and keep it concealed.
  518.  
  519. You might want to buy a card for a variety of reasons; here
  520. are just two of them:
  521.     
  522.     
  523.     
  524. Your card count is very low and there may be a chance of a
  525. five card trick, which is second only to a Vingt et Un and
  526. so very strong.  In which case buying the next card is a way
  527. of increasing your stake and your eventual winnings!
  528. The screenshot shows the player's card count at 6 in two
  529. cards: a five card trick is a possibility. Note that the
  530. player's cards have been turned over as a demonstration;
  531. normally they would be kept concealed
  532.     
  533. You have to take another card, since your card count is less
  534. than sixteen, but you have a good chance to make a card
  535. count between sixteen and twenty-one and you don't want the
  536. dealer to know what's going on
  537.     
  538.     
  539.     Twist - ask the dealer for another card.
  540.  
  541. You do this by clicking Select while the pointer is
  542. over the next card and you haven't staked any more chips. 
  543. The card is flipped over so that its value is revealed
  544. You might want to twist a card for many reasons; here are
  545. two of them:
  546.     
  547.     
  548.     
  549. If you have cards of value less than sixteen, then you
  550. aren't allowed to stick.  If you haven't many chips left,
  551. twisting the next card is for you!
  552.     
  553. If you have a card value of between twelve and fifteen, you
  554. might consider it to be too risky to buy a card, since it
  555. could well 'bust' you and you have staked enough as it is.
  556. The screenshot demonstrates this (normally the cards would
  557. be concealed)
  558.     
  559.     
  560.     
  561. As a matter of etiquette, if you have received a fourth card
  562. from the dealer and it brings your pip total to less than
  563. 12, you should turn the card face up and twist the last card
  564. to obtain your five card trick
  565.     
  566.     Squaring up at the end of a game
  567. Your turn comes to an end when:
  568.     
  569.     you 'bust': your card value is greater than 21
  570.     you 'stick': click Select over the dealer's cards
  571.     you have a five card tric
  572.     
  573. When the last two of these happens, the dealer then turns
  574. over his cards and deals more cards as required. He cannot
  575. stick at less than 16 also and he will bust if his card's
  576. make over 21
  577.     
  578. If the dealer has the same score as you, he will have won
  579. and he will take your total stake. If he busts or has a
  580. lower score, then you will receive back your total stake
  581. doubled
  582.     
  583. Your chips can grow in value beyond the dealer's capacity
  584. or you could loose all the chips you started with. 
  585. In both cases the game ends
  586.     
  587.     Iconbar menu items
  588. The Info item leads to a second menu,
  589. which shows the information which is available about the
  590. application
  591.     
  592.      About This includes program version and
  593. status
  594.      Help text This file
  595. provides detailed information about the application and
  596. how it can be tailored to suit your requirements
  597.      HelpPlay This is
  598. the file you are now reading
  599.     
  600.     Quit : This item
  601. removes the application from the desktop
  602.     
  603.     
  604.     Differences between the sample
  605. and full versions of the game
  606. You are using the sample version of the game.  The full
  607. version is not available yet, but it is proposed that the
  608. following extra features will be incorporated:
  609.     
  610.      A standard set of cards featuring 32k coloured
  611. sprite
  612.      Up to ten chip denominations: much higher scores
  613. and longer games are possible
  614.      Up to ten texts per message
  615.      Save game
  616.      Ace splitting into two player's hands
  617.      Sound
  618.      Veneers provided for backdrop, cards, chips,
  619. and settings for features, colours and positioning. The
  620. screenshots above show some of the veneers supplied
  621.     
  622.     
  623.     Application messages
  624. The program keeps a check on the play and will display a
  625. message if you attempt to do anything it doesn't like.
  626. During the initial game setup, several checks are made on
  627. the presence of key files and sprites.  If these are
  628. absent, the program will halt with an appropriate message
  629.     
  630. The EQlabs SDL port
  631.  
  632. SDL stands for Simple DirectMedia Layer, and is a generic API that allows authors to port programs (usually games) to multiple platforms that support SDL without having to do major re-writing to support a different operating system. The 
  633. Not only have those excellent chaps at  
  634.  
  635.  
  636. Bomberman
  637.  
  638.  
  639. Glutton
  640.  
  641.  
  642. Mad Bomber
  643.  
  644.  
  645. Munchman
  646. EQ Labs should be thoroughly congratulated for their sterling work in porting SLD to RISC OS. All it now needs is some dedicated programmers to pick up the challenge and start writing more games for RISC OS. In fact with the SDL and Paul Johnsons regular series on games writing, along with our serialisation of the Archimedes Games Writers Manual what more do you need to get coding? Oh yes a C Compiler, but then we gave away Easy C a few issues ago. So what are you waiting for?
  647. That's it for this gamesworld. The column will return on an in-regular basis when there is some more exiting gaming news to report.
  648. Paul Brett
  649.  
  650.  
  651.  
  652. ÿÿÿÿVOLUME3/ISSUE4/HUGHJ/INDEX.HTM Volume 3, Issue 4, The Hugh Jampton Experience
  653.  
  654.  
  655.  
  656. The Hugh Jampton Experience
  657. With your host... Huuuuugh Jampton!
  658. Well my column last time must have been well received as I am back again with my unique blend of comedy and insults. First off as the competition page seems to have vanished I thought I might start my own. There is no prize, just the fame and possible fortune that follows from getting your name mentioned in RISC World. So I have decided we are going to start with a caption competition. A friend of mine e-mailed me this photo a few days ago and we have had some jolly good fun coming up with captions for it. Our current favourite caption is shown underneath.
  659.  
  660.  
  661. I'm sorry the Managing Director can't see you now he's in a meeting.
  662. Can you think of a better caption? If so the why not e-mail it to the editor. If we think any are funnier then we will publish them next time.
  663. While we are on the subject of pictures Aaron had one sent to him by Andrew Harmsworth, who is a regular RISCWorld contributor. Apparently this happened outside the Physics department at The Leys School in Cambridge.
  664.  
  665. Slightly amusing you might think, but then again so far you haven't seen round the back of the lorry.
  666.  
  667. No, don't think I can come up with a caption any better than that already supplied by the owners.
  668. The RUSKStation portable
  669. Yes its official, the new RUSKStation portable has been released. If you don't believe me then why not surf on over to 
  670. More photos
  671. With this column rapidly generating a reputation for using photos to fill the space here are some other rather amusing images that have been sent to me over the last few weeks.
  672. First off a really helpful sign for anyone being pursued across the desert by a maniac in an an 18 wheeler truck.
  673.  
  674. Just to prove that it isn't just MicroSoft who deserve a battering here is an exclusive on a new design of Apple iMac computer.
  675.  
  676. And on a more general note here is the latest photo of a prototype specialist keyboard for those living in Liverpool, or indeed scousers living anywhere else for that matter.
  677.  
  678. With the current tie-ups between mobile phone manufacturers and a well know software development (and when I say development I think in terms of 1960's tower blocks) company from the US, this exclusive image of the latest Ericsson phone gives you a good idea of what we can expect in the future.
  679.  
  680. I think I will be going back to using two cans and a length of string. Finally here is a special present for that confirmed crop circle expert and anti Microsoft campaigner "The" Paul Vigay.
  681.  
  682. Hugh Jampton
  683.  
  684. ÿÿÿÿVOLUME3/ISSUE4/IYONIX/INDEX.HTM Volume 3, Issue 4, The new Iyonix PC
  685.  
  686.  
  687.  
  688.  
  689. The new Iyonix PC
  690. Insider takes a look at the information available so far...
  691. A couple of weeks before the Acorn South East show, in Guildford, Castle Technology Ltd suddenly unveiled a new computer and a new version of RISC OS (RISC OS 5) with a rather tantalising website at 
  692. Some background History
  693. In order to understand Iyonix its worth having some of the background history behind the project. The first important historical point came at the Acorn South East show at Epsom race course in the autumn of 2000. This was the show where the 
  694. Some of the details are sketchy for the following period, and even Insider doesn't have all the information. However at the 2001 RISCOS Ltd AGM in Paces' premises in Yorkshire Paul Middleton said that RISCOS Ltd had been doing some work on an X-Scale based podule for use in RiscPCs. At the time it was considered that this might be another type of processor upgrade, much like the Kinetic. However in actual fact it seems that this was a prototype version of what would become the Iyonix PC. The next important milestone occurs late in 2001/early in 2002. Since the new Castle machine would be XScale based, and the XScale is a 32 bit only processor (well it does have a 26 bit mode, but it is not supported) a 32 bit version of RISC OS would be required. An approach was made by RISCOS Ltd to try to licence the only 32 bit OS that that then existed, the one produced by Pace Microtechnology. It seems from the speech made by Paul Middleton at the RISCOS Ltd 2002 AGM that this approach was not successful.
  695. Anyone who attended the Guildford show will have seen the theatre presentation by Castle Technology Ltd. This clearly showed a slide that announced that the new RISC OS 5 was "Pace derived", so one might well assume that although RISC OS Ltds' approach to Pace didn't work, a later approach from Castle Technology Ltd must have. Keen Insider readers may well remember the following from the Insider column from RISC World Volume 2 Issue 2:
  696. As an endpiece last time I wrote the following "ask yourself a simple question, if you were Pace and could see that a small company which has a licence for a version of a product you own could be a possible competitor would you want any 32-bit RISC OS stuff released at all?" I am delighted to say the answer to this is yes. I am sure those involved will make a full announcement about 32 bit RISC OS when the time is right. One should of course remember that a 32 bit OS may well need a new computer to run it on, as well as new software.
  697. It might be wise to keep those words in mind over the coming weeks.
  698. The Iyonix itself
  699. Details regarding the Iyonix are sketchy in some areas. So far Castle Technology Ltd have not provided a release date or a suggested retail price. Despite the appearance of the machines at Guildford the OS is not finished, and was marked as an Alpha release on the machines on show. However what was on show was most impressive. It booted up very quickly, ran large high colour, high resolution desktops with ease and performed far faster than any RiscPC could. It will be very interesting to see how it compares with the MicroDigital Omega when that is finally released. A number of important applications were demonstrated running on the Iyonix including Draw, Paint, Vantage and Techwriter. The Aemulor emulator was also on display running complex applications such as Artworks (which is 26bit only) on the new 32 bit RISC OS. Potential customers, though, should remember that MicroDigital have said that an XScale equipped Omega will also be able to run 26 bit apps without requiring a software emulator.
  700. The Iyonix looks very promising and certainly seems to perform very well. We will all need to wait for more concrete information to emerge regarding the machine over the next couple of months. In the mean time I am reproducing a Castle Technology press release below.
  701. Castle Technology gave more information on the recently announced Iyonix PC 32-bit system to a packed audience at the RISC OS SE Show last Saturday. For those unable to visit this event some of the main details are:
  702. Entirely new motherboard design with
  703. 80321 XScale processo
  704. GeForce2 MX400 video car
  705. Up to 1GB DDR RA
  706. 32-bit and 64-bit PCI expansio
  707. H-speed podule bu
  708. UDMA 100 Hard driv
  709. MicroATX mid tower design with
  710. 5.25" and 3.5" drive bay
  711. 2 + 2 USB port
  712. 2 Serial port
  713. RISC OS 5 with RISC OS 4.02 feature set plus
  714. Long file name
  715. USB printin
  716. Unicode suppor
  717. OS in FDlash RO
  718.  
  719. Many applications have been converted to work in 32-bits, for example Fireworkz, Ovation Pro, Draw, Pain & Edit to name just a few. Speed increases range from 2.0x (podule bus) to 30.0x (expansion bus). If you were unable to attend this show then a full summary of Castle's presentation on the Iyonix PC can be found at the 
  720. To win an Iyonix PC for yourself please register on the 
  721. Mike Williams (akalat@kbnet.co.uk) on behalf of Castle Technology
  722. It is very interesting to note what is stated, and what isn't. As an example the hard drive is listed as being a UDMA 100 model, which is what one would expect. However note that the press release does not state the drive will be connected to a UDMA 100 interface. Also note that although the machine has serial and USB ports the parallel port seems absent. The choice of processor is also very interesting as it is one of the integrated XScale models. In some ways you could look at the Iyonix as a super A7000 replacement. Castle have said that the machine will ship with a 600MHz processor. It would seem from looking at the development machines that this is soldered to the motherboard, unlike the Omega which has a socket for its faster XScale chip.
  723. And finally
  724. I have to say that personally I like the Iyonix a great deal and I am very impressed with the work done by Castle. However I also like the Omega and I am impressed with MicroDigitals work as well. I eagerly await having both machines on my desk so I can compare them. As a final note a colleague of mine made an interesting comparison the other day, he compared the Iyonix to the Phoebe. We will have to wait to see how apt this comparison actually is.
  725. Insider
  726.  
  727.  
  728.  
  729. ÿÿÿÿVOLUME3/ISSUE4/LETTERS/INDEX.HTM Volume 3, Issue 4, Letters Page
  730.  
  731.  
  732.  
  733.  
  734. Letters Page
  735. Its the page written by you for us.
  736. Hi,
  737.  
  738. I am just writing to say hi and keep up the good work with the ma
  739. i got the 3 year sub option just in time to get iss 3-1 and read the c
  740. from cover to cover and then the vol 1 +2 cd's as well and liked wha
  741. i saw more and more the further i read in to it i am sorry i missed out on
  742. the comp's as i was having trouble with my internet connection
  743. (BT) so it sometimes would not go on line and sometimes get on but then
  744. freeze up on me . I have done some work with DR Wimp from ray favre an
  745. have released two pieces of freeware through archive mag and my web sit
  746. expansion card and !Pport to control the printer port i will e-mail you a
  747. copy of both if you want. Oh sorry to hear of your troubles with your
  748. Lotus 7 replica hope you can get it sorted soon
  749. cheers and thanks for all your hard work on the mag.
  750.  
  751. Thats all folks
  752.  
  753. from Cat & Moss
  754. Thank you for the kind words, we do try hard with RISC World, although I must say that even with three people, including myself, checking for mistakes an unacceptable number are still getting through. The only current problem with the Lotus 7 replica is the weather, it's too cold and wet to drive the damn thing. Still back to the subject of mistakes....
  755. Dear Aaron,
  756.  
  757. Something fun seems to have happened to my article... BTW : Didn't think much to the AGM report - Hugh Jampton's was better.
  758.  
  759. TTFN
  760.  
  761. Paul Johnson
  762. Something fun? I did ask Paul for further details and it seems the end of the article was messed up somehow. It looked fine here, did any other readers have a problem? If so let us know as it could be browser specific. It was agreed by those present that some parts of the AGM were too sensitive to be reported in the media. And now a heartfelt Christmas message...
  763. Hi,
  764.  
  765. You know, if I don't get my RiscStation laptop by Christmas, I shall buy a PC laptop in the New Year Sales, and run VA5000 on it!
  766.  
  767. (And you may quote me!)
  768.  
  769. A P Harmsworth
  770. Ah, did any one notice the cunning way I managed to insert a VirtualAcorn plug into the middle of the letters page? And I didn't even have to write it myself! The latest on the RiscStation laptop is that there has been a problem with the prototype motherboard (perhaps a broken collar bone? - HJ) and it is being re-done as I write this. Let's hope it finally makes an appearance soon. And on the subject of things appearing...
  771. Hi,
  772.  
  773. Thanks for the latest copy/edition. However, you need 'stickier' stamps! I have just collected my copy from the post-office and had to pay 99 pence for the pleasure. Can't make any comments on the contents as I haven't had time to look at it
  774. Regards,
  775.  
  776. J Vanags
  777. I can only apologise. RISCWorld actually gets mailed out by the Post Office and should be franked. So anyone who has had this happen to them on last issue and has already contacted APDL (before this issue is delivered) should get a free book of stamps. (Note however that you don't get a bookmark in case you get interrupted half way through reading it - HJ).
  778. Hi,
  779.  
  780. The Index page is blank in my copy of Vol 3/3, both via the !RWORLD icon and INDEX/HTM. I can see what's in it by shift-clicking the latter, and of course can get into the contents via the HTML directory, but it's not very convenient . . . any chance of a replacement disc?
  781. Another weird one this, again did any one else have the same problems? And this prompts a quick reminder, although I edit RISC World I don't do the CD production or mailing, so if you have a problem with one of these you will need to contact 
  782. Hi,
  783.  
  784. RE : Ancestor+ and Genealogy
  785.  
  786. With APDL developing and selling Ancestor+, and helping to produce RiscWorld, why not include a series of articles on the subjects in RiscWorld. Some may say that it could be interpreted as advertising for APDL, but providing Hints & Tips for any RISC OS application should be part of RiscWorld's task. If you sell a few more copies, why not.
  787.  
  788. With the vast amount of rapidly growing information on the internet for searchers of their ancestors, detailed advice on how to access particular sites and extract information that might be useful. There must be a number of RISC OS users who have a lot of experience and knowledge that will be useful to others.
  789.  
  790. I have tried WebsterXL but it does not seem to be very effective. Perhaps it can be used but I do not know how. Oregano does get reasonable access, but it is obvious talking to some friends using Windows software that they are more successful.
  791.  
  792. The sort of problems / issues we have encountered may help to assemble Hints & Tips articles or more detailed tutorials.
  793.  
  794. 1901 census using Oregano. The screen is black. Luckily someone on Archive-on-line pointed to Display > Use document colours It took me a long time to find this can be unticked from the Choices > Text page.
  795.  
  796. Searching for a particular name within a year +&- band can produce a large number. Saving these can produce a problem as I have found only alternative pages are saved,  eg 1-30, 61-90, 120-150. Back-searching, changing to forward, other tricks, does not seem to make any difference.
  797.  
  798. An ex-work colleague told me how the family group reference number can be found by holding the mouse pointer over the icon to the left of the name. I would not have found this myself as it only becomes apparent when the page covers the full width of the screen (800x600) or using a higher resolution screen. He also said that the Census PRO reference number can also be found from the free downloads. Useful when a person can get direct access to the census films themselves, saving a great deal of time in an office. I have not seen how this can be done using Oregano. Another friend I mentioned this to, told me that for MSPC users there is a  free downloadable program that will sort a large surname download joining  families together using the family reference. Even more difficult when only alternate pages download. For us this has to be a pencil and paper job - very time consuming.
  799.  
  800. IGI - A name search can only be downloaded as text. There is an instruction for 'Select records to download (50 max)' This appears to do nothing so each has to be individually downloaded. However this individual's page can download as HTML.
  801.  
  802. Just a few points on what can become a time and cash consuming activity. Sharing information must be very helpful, but could also be a spur to others to get started and spend money on Ancestor+.
  803.  
  804. What was meant to be a short note seems to have grown - apologies
  805.  
  806. Eric Dobson
  807. Well that sounds like a reader challenge to me. Neither myself or Dave really know enough about genealogy on the Internet to be able to sensibly write about it, perhaps one of our readers does? If so please get in contact. Still here is one I might well be able to help with.
  808. Hi,
  809.  
  810. I've been following your networking series and have now go my PC running Windows XP and a RISC PC running RISC OS 4.29 networked using a crossover cable. I am interested in your latest article 'sharing an internet connection' as this would freeup my serial port on the RISC PC. Being a 'non techi' could we have a step by step instructions on how to configure Oregano to access the modem on the PC please.
  811.  
  812. Regards
  813.  
  814. John Vann
  815. Check out this issue's networking series as it may well help.....
  816. Dear Aaron,
  817.  
  818. Just reading my column. Well, someone has to! I note that two GIFs are broken, as the image file names are broken on the CD. :-(
  819.  
  820. Andrew Harmsworth
  821. Yes, I have been meaning to mention this for some time but keep forgetting. A number of authors send in articles using long file names, we don't use long file names as it allows our readers to copy articles to their hard drive for later reference if they want to. Someone using RISC OS 3.7 or earlier would end up with truncated file names and the HTML might not work. So I always try to knock things down to use short file names, and sometimes I miss a file or to. So would it be possible to get submissions in with short file names. Note that this is totally my fault for not telling the authors, not the authors fault!
  822. We will leave the final word to Alan Shooter.
  823. G'day Aaron,
  824.  
  825. Here is my penny worth. My brother sends me the Acorn User when he ha
  826. read it. Many years ago I used to have a subscription but due to th
  827. third world value of the NZ dollar and the poor wages I would miss ou
  828. if I did not get it sent. My brother doesn't think much of it, but 
  829. find some parts keep me up to date. the parts I like are News, Comms an
  830. hardware reviews. I can read a mag during my half hour lunch break or i
  831. bed, the monitor is to heavy to take to bed.
  832.  
  833. I liked the competition and entered when I didn't have the prize o
  834. would have found it useful, give other people a chance. I like simpl
  835. competitions that don't take up a lot of time.
  836.  
  837. We get the BBC World Microsoft propaganda program, Click On Line, an
  838. this from the company that gave its name to a computer. What this sho
  839. does is to show us what is lacking in our internet browsers.
  840.  
  841. I always thought that Acorn put too many eggs in one basket and jus
  842. waiting to be picked off. When I had a trip back to the UK people use
  843. to say "get a Acorn, we used them at school" insinuating they were onl
  844. good enough for kids. Well I am a big kid then!!!!
  845.  
  846. When talking to a IT person, he said why would he want to put himsel
  847. out of work with recommending a reliable system.
  848.  
  849. I would like to thank Dave Holden for the help he gave me with th
  850. Interface and CD writer that I got from APDL.
  851.  
  852. Dave's article on CDBurn is very easy reading, but and there is always 
  853. but. At the end of the second part the last sentence states, "In th
  854. next session we'll wind up with a look at mixed audio and data CDs. Par
  855. 3 turned out to be Multi-session and re-writable CDs. I was lookin
  856. forward to this article. I copy audio cds to use in the car, we als
  857. have the people who nick from cars and also the sun does a lot o
  858. damage. When I have copied a cd with a enhancement to play on a compute
  859. I find the track that is linked with the video bit copies about half wa
  860. and then falls over. My personal view is that record companies ar
  861. conning me by selling me a cd that part of it is useless because it wil
  862. not play on my system. I should be able to get a cheaper CD that has th
  863. audio tracks only. I would like to see a more in depth article abou
  864. making a audio compilation cd, or maybe I am just not getting what ha
  865. already been in article 2.
  866.  
  867. I must say I have had very good service from all the suppliers I hav
  868. used in the UK. My last major purchase was a DigiFlash card reader whic
  869. I discussed via e-mail, before I went a head and purchased a cano
  870. camera in Dunedin.
  871.  
  872. As just a user of a computer I hope this gives you some idea of wha
  873. interests me.
  874.  
  875. Regards
  876.  
  877. Alan
  878. Aaron Timbrell
  879.  
  880.  
  881.  
  882. ÿÿÿÿVOLUME3/ISSUE4/LINKHTML/INDEX.HTM Volume 3, Issue 4, HTML Link
  883.  
  884.  
  885.  
  886.  
  887. HTML Link
  888. Dave Holden describes another of the RISCWorld HTML tools
  889. !HTM_link
  890. Introduction
  891. Inserting a Text link
  892. Remote Text links
  893. Inserting an Image link
  894. Using an image as a link
  895. Image borders
  896. Clear All and Clear Part
  897. Relative links
  898. Use with !Edit
  899.  
  900. Introduction
  901. This started as a simple  program to insert the <img.... etc. tagline for a Sprite, JPEG or GIF into an HTML file. It then grew to enable the image to be a link to another file, or image, or a remote URL, or to just insert a text link to another file or URL. Basically, it inserts images or image or text links to local or remote files.
  902. The iconbar menu has two main items, 'Image' and 'Link'. 
  903. 'Image' will insert links to images, or links from images (ie. click on the image to link to another file). It is therefore used to create both links and to simply insert a passive image into the page.
  904. 'Link' just creates a textual link.
  905. Clicking SELECT on the iconbar icon is equivalent to selecting 'Image' and clicking ADJUST is equivalent to selecting 'Link'.
  906. Inserting a Text link
  907. This is the simplest, so I'll deal with it first.
  908. Click ADJUST on the iconbar icon or select 'Link' from the menu and the Link window will open.
  909.  
  910. The top item, labelled 'Source', is the source file you're inserting the link into. Drag this file to the icon and its full pathname will appear.
  911. The second item, labelled 'Link to', is the file you want to link to. This can be another HTML file, a text file, image (sprite, JPEG, GIF, etc.) or some sort of archive. It can also be a remote URL (see later). Assuming it's a local file drag the file or image you want to link to into the second icon icon labelled 'Link to' and its name will appear. 
  912. Before you can create the link you will need some text in the third icon, 'Link text'. This is the text the reader will see highlighted in their browser window and which they click on to make the link.
  913. Now you need to load the HTML file where you want the link to appear into an editor. This can be Zap, StrongEd, Edit, or whatever you use to write or edit your HTML. Place the caret/cursor exactly where you want the link to appear and click on 'Insert'. The link will then appear in your editor.
  914. Remote Text links
  915. Linking to a remote URL, that is, a www address, is similar. Obviously you can't drag the file to the 'Link to' icon, so click on the 'www link' button and the 'Link to' icon will be cleared and 'www.' will be placed in it ready for you to enter the address you want to link to. Enter the link (for example, to link to the APDL web site you would just enter 'apdl.co.uk' after the 'www.') and click on 'Insert' and the text will appear in your editor just as before.
  916. If 'www.link' is selected when you drag a local file to the 'Link to' icon then it will be de-selected automatically and 'Local link' selected.
  917. Inserting an Image link
  918. This is similar to inserting a textual link but it's a bit more complicated as there are more options to consider.
  919. Click SELECT on the iconbar icon or select 'Image' from the menu and the Image window will open.
  920.  
  921. Drag the HTML file you want the link to be inserted into to the top icon, labelled 'Source', and the filename will appear.
  922. The top icons in the Image and Link windows are cross-linked so that a file dragged to one will also appear in the other. This saves you having to repeatedly drag a source file to the windows if you are inserting both types of link into the same file. (See the section 'Relative links' later for more about this).
  923. Now drag the the image you want to insert the tag for to the second icon, labelled 'Image', where its name will appear. The width and height will be read and show in their icons. You could edit these if you want to expand or contract the image (and if you know what you're doing!).
  924. It's possible that a JPEG's size may not be correctly interpreted. This will not happen if it's a straightforward image that has been 'passed through' a RISC OS program such as ChangeFSI but there could be problems if it has been created in a program on a Mac or PC. If the program isn't sure of the dimensions it will put a '?' after them. If the numbers look about right (and they usually will) they almost certainly are.
  925. If you want your image to be centred in the browser window, which would normally be the case if it's an large picture or illustration, then make sure 'Centre image' is ticked. This will wrap the image link in <CENTER> . . . </CENTER> tags.
  926. The 'Align text' options at the bottom left hand corner of the window are used to define the position of text following the image. In theory 'Top' should see the text continuing from the top of the image, so if the image was left-aligned the text would appear to 'flow around' it on the right hand side. Most browsers don't implement this, so you are advised not to use it, except for a short caption. 'Middle' and 'Bottom' mean that the following text should continue from either the vertical centre or level with the bottom edge of the picture. This is normally used to place a small caption to the right of the picture. 'None' is the default.
  927. If you have not selected 'Centre image' or any of the text alignment options (that is, 'None' is selected) then it is a good idea to select '<BR> after image'. This places an end of line tag after the image to ensure that following text (or image) starts on a new line below the image, otherwise it may begin to the right of the image, which can look a bit strange.
  928. If you want to have any alternative text for your image then enter it into the icon labelled 'Alt text'. This is text which will appear in a browser if the image can't be found or in a text only browser or if images are turned off. Most browsers will also show this text while waiting for the image to be downloaded.
  929. When you have set all the options as you want place the caret in your source file where you want the image to appear and click on 'Insert'.
  930. Using an image as a link
  931. If you want the image to be a link to another file (or image) then proceed exactly as above but also drag the file you want to link to to the third ('Link to') icon. Its filename will appear there and the appropriate information will be included in the tag inserted into your file.
  932. As with text links you can use an image to link to a remote URL. Click on 'www.link' and 'www.' will appear in the 'Link to' icon ready for you to type the www address you want to link to.
  933. Image borders
  934. If you want your image to have a border the width of this in pixels can be entered into the 'Border width' writable icon.
  935. Where an image is not used to link to another file then it will not have a border unless one is specified. However, if it is used as a link then, even where no border is specified, most browsers will place a 1 pixel wide border around the image. This might not be what you want, so in this case it is necessary to specify a '0' width border, which is why the default width in this icon is '0'. 
  936. If there is no link from your image and you don't want it to have a border you can delete the '0' to leave this icon blank. No 'border' tag will then be used.
  937. 'Vspace' and 'Hspace' are used to place an 'invisible border' around an image. This will ensure that text or other images above and below or to the left and right of an image leave a gap.
  938. Clear All and Clear Part
  939. The two 'Clear' buttons have different effects. 'Part' blanks the 'Image File', 'Alt text' and 'Link to' icons but leaves 'Vspace', 'Hspace' and 'Border Width' so if you are inserting a series of images with similar characteristics (eg. several aligned buttons) you don't have to re-write these values. 'All' also clears these icons. Neither Clear button wipes the 'Source file' icon as it is assumed that you will either be inserting more data into the same file and if not it will automatically be replaced with any new filename you drag there.
  940. Relative links
  941. The reason the Source File has to be dragged to the top icons is so that the program will know where it is and so can work out the relative positions of the Image file and/or links. The program should cope with links to files which aren't in the same directory, whether they're in a sub-directory or a higher level directory. It will try to trace the two paths back to a convergent point to create a relative link.
  942. In fact, once you've established the path to the source file by dragging it to the window if you want to insert links into a different HTML file which is in the same directory as the first file you don't need to drag the second file. It's the POSITION of the HTML file that matters, not the name of the file itself.
  943. Remember that the link will be inserted wherever you have placed the caret when you click on 'Insert'. This has nothing to do with the filename in the 'Source' icon, that is just used as the 'anchor point' for relative links.
  944. Use with !Edit
  945. During the final testing of this program a problem arose when using it with !Edit. This is something which I had discovered a long while ago, but as I haven't used !Edit for years, I had completely forgotten about it. If characters appear too fast then when it's buffer is full !Edit 'loses' characters, typically about every 20'th one. The same thing can happen with some other programs (eg. Pipedream), but !Edit is the only one you're likely to be using to writer HTML.
  946. To avoid this problem the program can be set to sent the characters slowly enough so that !Edit can cope. If you look in the !Run file of !HTM_Link you will see a line;
  947.     Set Link_Edit_Compatible "On"
  948.  
  949. If you are using an editor such as !Zap or !StrongEd then you can change the "On" to "Off". This won't make any difference to the operation of the program but the characters will appear almost instntaneously instead of the line unravelling more slowly.
  950. !HTM_link is Copyright © David Holden 2002.
  951.  
  952.  
  953.  
  954. ÿÿÿÿVOLUME3/ISSUE4/MAKEHTML/INDEX.HTM Volume 3, Issue 4, Impression to HTML
  955.  
  956.  
  957.  
  958.  
  959. Impression to HTML
  960. Dave Holden describes his Impression to HTML converter
  961. Impression to HTML
  962. Companion programs
  963. What will it convert?
  964. How Imp-HTML works
  965. What needs to be done
  966. Using the program
  967. Output file options
  968. Chapter numbers
  969. Adjust headings
  970. Capitalise files
  971. .HTM extension
  972. Auto UL
  973. Choosing a Mapping file
  974. A demonstration
  975. Saving Choices
  976. Editing a Mapping file
  977. Altering the definitions
  978. Editing the Effects
  979. Editing the Styles
  980. More on the Styles menu
  981. Saving a Mappings file
  982. Creating a Mappings file
  983. Scanning the TextStory
  984. Setting the Styles
  985. Saving the file
  986. Style 'culling'
  987. Appendix
  988. Setup files
  989.  
  990. Impression to HTML
  991. This program was originally written to enable me to convert long multi-chapter manuals for programs written in Impression into multi-file HTML documents complete with illustrations and an Index file with links to appropriate places in the text. Other people have a similar requirement and have probably found, like me, that the various other tools available to do this just don't do a very good job and require too much editing and alteration to the HTML afterwards.
  992. Companion programs
  993. There is a program to do the same for Ovation Pro. This is functioning perfectly but still needs some work to make it 'user friendly'. This will be published on the next edition of RISCWorld.
  994. There is also HTML-DTP which does the opposite, that is, it takes an HTML file or series of files and converts them into a form suitable for loading into Impression or Ovation Pro.
  995. Finally there is HTM_link. This is used to insert image tag and links into HTML files and makes this very easy and avoids those silly mistakes we all make when 'hand coding' HTML.
  996. What will it convert?
  997. This program does not attempt to produce a DTP-like HTML file. This is simply not appropriate. HTML is not really a suitable medium for complex layout structures. The original aim was to convert program manuals, where the layout is fairly straightforward, and this it does very well,
  998. Imp-HTML is not suited to 'fancy' documents with multi-column text running around lots of pictures or where formatting and layout are of prime importance. This can be done in HTML with frames, tables, specifying fonts and font sizes, etc. and some programs, especially on PCs, try to do this. What you usually end up with is a complicated, bloated, HTML structure that will look lovely in its target browser and platform (usually Internet Explorer on a PC) and take ages to render (if it renders at all) in other browsers on other platforms and often look nothing like the original anyway
  999. Briefly, if you have something with more pictures than text, a complex layout and which requires specific fonts or font sizes then this program will not be able to reproduce the document in HTML. If it's a book-like document which is mainly text with or without illustrations then Imp-HTML will almost certainly do it.
  1000. How Imp-HTML works
  1001. The program does not use the original Impression document file. Instead it works with text files saves from Impression. If you use 'Save text story' and ensure that 'With styles' is ticked then Impression will save the complete text story with all its Styles and effects, so headings, bold and italicised text, etc. can be correctly interpreted.
  1002. The disadvantage of this system is that all graphics are lost. However, in practice this isn't really a problem. With a printed manual the writer will often include a lot of graphics that are not absolutely necessary simply because it's easy to do so. Too many graphics in an HTML document can make it slow to download or render and, because you don't have such exact control over layout, may make it look very messy.
  1003. So, by separating the conversion of the textual part of the document from the graphics you have precise control over what graphics are inserted, where, in what format and whether you wish to apply a scaling factor. For example, with a booklet it may be best to position a graphic slightly before or after the text which refers to it to suit page layout. As the reader will have the pages open before them when reading it won't matter if they have to look across at a facing page to see the picture. With HTML, if the picture is in the same place relative to the text, this might well place it completely out of sight when reading the document on screen.
  1004. What needs to be done
  1005. There are several main operations that must be performed when converting an Impression Text Story to HTML;
  1006. Any 'special' characters such as the pound sign, < and >, etc. must be converted to their appropriate HTML equivalents
  1007. Bold, italic and centred text must have appropriate tags inserted
  1008. The various styles used in the Impression documents need to be 'mapped' to suitable HTML 'styles' so that headings, sub headings, etc. are given appropriate HTML equivalents
  1009. Create an 'index' which provides links to selected headings and sub headings and break the file up into chapters if required
  1010.  
  1011. Some of these operations will be the same for almost all Impression files. For example, character translation and bold and italic effects will be the same in any document. Others, such as mapping Styles to HTML, when to start a new chapter and which items should appear in the index file may be different for each Impression document.
  1012. All of these parameters are set in external text files within !Imp-HTML so they are not fixed. To cope with different Impression files you can have many different mapping files (the files which define which Impression Styles are mapped to which HTML tags and which appear in the Index). These can be selected from a menu in Imp-HTML which also includes tools to make creating these files very simple.
  1013. Using the program
  1014. Before you can convert an Impression file you need an appropriate Mappings file. A 'basic' file named 'DefaultMap' is provided and there is also one called 'Manual' which was designed to work with the format used to write this manual. As this TextStory is provided with the program you can use it with this mapping file to make an HTML version of the manual to demonstrate how the program works.
  1015. Load Imp-HTML by double-clicking on the application icon and it will install itself on the icon bar. If you click MENU on this icon a menu will appear with the usual 'Info' and 'Quit' items at top and bottom and three others, 'Process', 'Mappings' and 'Save Choices'. More about the others later, but for the moment select 'Process' and the window below will open. You can also open this window by clicking SELECT on the iconbar icon.
  1016.  
  1017. At this stage there is a 'greyed out' directory icon on the right hand side. Drag the Impression TextStory to the icon at the top of the window labelled 'Source file'. Its name will appear there, the directory icon will become 'active' and the instruction 'Enter name and drag dir. icon to convert file' will appear at the bottom. 
  1018. Output file options
  1019. The 'box' at the bottom left of the window defines the form the HTML file(s) will take. There are three options;
  1020. Separate chapters will divide the HTML into chapters at predetermined points with a separate index file
  1021. File + Index will create two files, one called BODY which contains the main document and a separate INDEX file
  1022. Single file makes a single long HTML file with an index at the start of the fil
  1023.  
  1024. The first two methods create a directory in which the files are placed. The name shown in the 'Save as' icon is the name of this directory. If there are any graphics files to be included these can then be placed in this directory or a sub-directory.
  1025. The third method, 'Single file', creates a single HTML file so there's no need for a directory. In this case the name in the Save as icon will be the name of the HTML file and the icon will change from a directory to an HTML file icon.
  1026. Chapter numbers
  1027. When you split your file up into separate chapters they are given names with a numeric suffix. These would normally be in the form CHAP01, CHAP02, CHAP03 etc. If the original file also has chapter numbers and you want to arrange for the file names to correspond with them they might be out of step if there is something such as a Preface or Introduction before 'Chapter 1'.
  1028. This option enables you to adjust the numbers given to the HTML 'chapter' files. By clicking on the 'bump' icons you can make the numbers begin with '00' or even negative numbers, so that if your document does have a Preface that would be CHAP00 so that Chapter 1 of the document would correspond with CHAP01.
  1029. Adjust headings
  1030. When you use a Style to set a heading or sub-heading in Impression the code to set the style is normally placed at the start of the line but the code to end it will usually be placed at the start of the following line. When this is converted to HTML it will (usually) look OK in a browser but it produces messy code.
  1031. If this option is ticked then the program will try to adjust this by moving the code to cancel the style to the end of the preceding line. This produces 'cleaner' HTML which makes it much easier if you wish to edit or adjust it manually later.
  1032. Capitalise files
  1033. If this is ticked then filenames will be in upper case, CHAP01, CHAP02, etc. If it isn't ticked the filenames will be in lower case, chap01, chap02, etc.
  1034. In either case all HTML links in the index file will be in the same case.
  1035. This is largely cosmetic as RISC OS and Windows filing systems aren't case sensitive However, Linux and Unix are, so if, for example, you were to transfer files to a case sensitive system (and remember that most web servers are Unix based) via a DOS format disc then it would be best to make sure that all the links are upper case.
  1036. .HTM extension
  1037. If this is ticked then all files will be given a .HTM file extension (or .htm if 'Capitalise files' is not selected). This would be normal unless you are sure that your files will only be used on a RISC OS system.
  1038. Auto UL
  1039. If this is ticked then the program will try to create <UL> constructs.
  1040. If it finds a line starting with a 'bullet' character (ascii 143) it will begin a <UL> construct and each bullet will be translated into a <LI>. It will close the construct by inserting a </UL> when it finds a line that doesn't begin with a bullet. If there is a Tab character following the bullet, as is normally done in Impression, this will be ignored.
  1041. This system is not infallible, but it does normally work quite well. The most common problem is if you have one of the 'bullet sections' divided into two paragraphs. This will result in the HTML being terminated and re-started. However, you will normally be able to see this in the finished product and correct it manually.
  1042. Choosing a Mapping file
  1043. If you click on the menu icon to the right of the icon labelled 'Mapping' a menu will open listing all the Mapping files available. With the basic program there will be only two, the 'DefaultMap' and 'Manual', which is provided to enable you to experiment with the text of this manual. To choose a Mapping file just select it from the menu and it will be loaded and its name will appear in the icon.
  1044. A demonstration
  1045. Open the 'Process' window and drag the 'TextStory' file supplied with this program, which is the text of this manual, to the icon at the top of the window. Select the 'Manual' Mapping file and set 'Adjust headings' and 'Auto UL' so they are ticked. Select 'Separate chapters' and '1st chapter' to '1'.
  1046. Now drag the directory icon to a suitable filer window.
  1047. The icon at the bottom of the window will inform you as the program creates each chapter and will say 'Finished' when it is done. At this point the directory icon will once again be 'greyed out'.
  1048. Unless you have changed the name in the Save as icon a directory called HTML will have been created and in it will be several HTML files. Their exact names will depend on the sate of the 'Capitalise files' and 'HTM extension' icons, but there will be an Index file and a file for each chapter.
  1049. If you load the Index file into a browser you should find that it contains a series of HTML links. The 'major' ones will be to each individual chapter. The start of each 'chapter' has nothing to do with Chapters in Impression. They are defined (in this case) by the chapter headings, such as the 'Using the program' heading at the start of this section. The 'minor' links are to the sub headings, such as 'A demonstration' above.
  1050. If you click on any of these links the browser will load the appropriate file and, in the case of the minor links, scroll to the sub-heading.
  1051. You could experiment with the other options. If you select 'Single file' you will find that the program creates a single, long, HTML file with the index at the beginning.
  1052. Saving Choices
  1053. If you select 'Save choices' from the iconbar menu then the settings in the lower part of the window will be saved in a Choices file. The next time you run Imp-HTML they will then be set they way you have chosen.
  1054. Editing a Mapping file
  1055. This is actually the most complex part of the program. 
  1056. If you click ADJUST on the icon bar icon or select 'Mappings' from the menu the mappings window will open.
  1057.  
  1058. There's a lot going on in this window. You will see that it's divided into three main areas. 
  1059. At the top left are the 'Effects'. This is where you set the HTML codes that will be used for Bold, Italic, Underline, Centre and Tab.
  1060. At the top right is the section which enables you to load existing Mappings files for modification and to save files.
  1061. The main part of the window is where Impression Styles are given the characteristics that will be used in HTML documents.
  1062. Altering the definitions
  1063. You could create a completely new Mapping file but it will be easier to begin by looking at a completed one. Click on the menu icon labelled 'Edit file' and a menu will appear with the names of all the available Mapping files. At present this will just show 'DefaultMap' and 'Manual'. Select 'Manual' and the file will be loaded and its definitions will appear in the window and its name will be shown in the icon under the 'Edit file' label. The 'Effects' section of the window should now look like this.
  1064.  
  1065. Editing the Effects
  1066. The top four items, Bold, Italic, Underline and Centre each have an icon where the HTML code used to switch the effect on and off is shown. You can enter these affects either by typing them in directly or by selecting from the menu that will appear if you click on the corresponding menu icon.
  1067.  
  1068. The top item on the menu is 'Clear', and if you click on this the icons for that item will be cleared ready for you to enter or select a new code.
  1069. The last item is 'Newline'. This doesn't put a <BR> code in the HTML to break the line, it puts a '\n' code in the Effect definition which just places a newline character (ascii 10) in the file so the source file will have the line split at that point. This is done just to make the source file easier to read and edit. For example, it is used with the 'centre' code to make centred lines more obvious. 
  1070. The last item, Tab, obviously requires only one icon. Again there is a menu but it's much simpler. As there's no direct equivalent to the Tab character in HTML and multiple spaces are concatenated to a single space the best option if you must have some sort of Tab is multiple   codes (non-breaking spaces).
  1071.  
  1072. The final two buttons in this window are 'Clear' and 'Default'
  1073. 'Clear' will clear all the Effects icons ready for you to select or type new codes.
  1074. 'Default' will insert a series of default codes as shown
  1075.  
  1076. Editing the Styles
  1077. The Styles section of the window is shown below.
  1078.  
  1079. The icon labelled 'Style name' shows the name of the Style as it appears on Impressions Style menu. The other two 'white' icons show the HTML codes that will be substituted for the 'on' and 'off' commands for these codes. These icons, like those for the effects, are writable, so they can be entered (or added to) manually or selected from a menu. If you click on the menu icon on the right the menu shown will appear, and selecting anything from this menu adds the appropriate 'on' and 'off' codes to the contents of the icons. 
  1080.  
  1081. Instead of describing the actions of all the icons I'll describe each Style in the example above and explain how it is used and what effect the various buttons have on it.
  1082. First there is Main Heading. In the original Impression document this is centred 28pt bold, and is used at the start of each main section or 'chapter'. So, <H2> has been chosen, and it is also centred. Because the use of this Style signifies the start of a new chapter the icon on the extreme right, labelled 'NC' (for New Chapter) is ticked. When creating multi-chapter HTML this will begin a new chapter file whenever this Style is found. Styles where 'NC' is ticked will also automatically appear in the Index file so there's no need to tick this as well.
  1083. Sub Heading' is used in the original document for the headings to each section, so I've chosen <H4> as an appropriate tag. 
  1084. The three buttons labelled 'p', 'br' and 'none' define what (if any) tags are used at the end of each line, or, more accurately, each time a linefeed (ascii 10) character is found. As Impression exports text unformatted this will only appear if you pressed RETURN when writing the text, such as at the end of a paragraph.
  1085. 'p' means that each paragraph is wrapped in <P> and </P> tags. This is what you would use for the main body of your text. This is 'on' by default, so it will be applied to the one Style not shown on the menu but which exists in all Impression documents, namely 'Normal'. As with Impression, this is simply the default text used in the browser. As it happens, since this is a fairly simple Mappings file, all the other styles don't use <P> and </P>, so none of them have this option set.
  1086. 'br' means use <BR> at the end of a line instead of <P> and </P> so there will be no gap between paragraphs as is otherwise the case. This is used for the Style NoGap. In the original Impression document there is normally a 3pt gap between paragraphs to separate them. NoGap is the same as the main body text but without this gap and is used where I don't want a gap between lines when I press RETURN. In the HTML mapping it has no definition other than having 'br' selected, so it's the same as the main body text but will have <BR> at the ends of lines so there won't be a gap between paragraphs, just as in the original document.
  1087. 'None' means exactly that . There is no <BR> os </P> tag at the ends of lines. This is applied to the two Heading Styles because these are used only for single lines (Main and Sub headings) and in HTML an <H?> tag always begins a new line and a new line is begun after an </H?> tag so there's no need.
  1088. The Style Code would be used in the original document where I wanted to enter something like example code and is defined with a monospaced font (actually Corpus) and no gap between lines. This is therefore converted to <PRE> tags in HTML with no tags at the end of lines as all browsers will being a new line in <PRE> mode when they find a linefeed but many will add another when they find <BR>, so if <BR> was used the text would all be double-spaced.
  1089. More on the Styles menu
  1090. This menu is 'user configurable' (see later) so you can have whatever codes you prefer on it and omit those you don't use to make it more manageable.
  1091. The 'Fontsize +1' and 'Fontsize +2' items can be used, often in combination with a Bold tag, to give larger than normal text where you don't want to use an <H?> tag. As the tags can be edited after you've selected them it's easy to alter this to '+3' or even '-1' after you've selected them so you don't need a menu entry for everything you might want to use.
  1092. 'nbsp' inserts a   tag but only in the 'on' section. This is a simply way of indenting a sub heading by a small amount.
  1093. 'Line' inserts a <HR> tag into the 'on' section. This is useful in long HTML documents, especially if you are not breaking it up into chapters as it can be used to provide a 'visual' break between sections.
  1094. Saving a Mappings file
  1095. To save a mappings file just click on 'Save'. Unless this is a new file (see next section' you may want to change its name first. If you try to save a file and one of the same name already exists you will be warned first.
  1096. When you save a Mappings file only those Styles where the icon at the extreme left is ticked will be included. This lets you omit styles which have no appropriate HTML equivalent. Imp-HTML will simply ignore any styles that aren't included in the Mappings file so they'll appear in the base style.
  1097. Creating a Mappings file
  1098. In the previous section we loaded and examined a pre-existing Mappings file. If, like me, you tend to use variations on a few standard layouts for your documents this is a good way of working. However, at some point you will need to create a Mappings file from scratch.
  1099. Scanning the TextStory
  1100. Open the Mappings window and drag a TextStory saved (with Styles) from Impression. Once again I'll use the TextStory of this manual as an example
  1101. The window will clear any previous definitions and, after Imp-HTML has scanned the file looking for all Style definitions, the Styles section should look like this.
  1102.  
  1103. On the left are shown all the Styles that Imp-HTML found. You will see that there's one more than appeared in the previous example, Contents. This is because the Style was present in the original document but I didn't bother to include in in the Mappings file as it is only used in a part of the document that is not going to be converted to HTML, namely the Contents.
  1104. By default all Styles are 'selected' for inclusion in the Mappings file (it's easier to re-load and remove a Style you've included by mistake than add one you've forgotten to tick) and the 'p' switch is set.
  1105. The 'Effects' at the top left are all blank. You can either enter specific codes or just click on 'Default'. Later I shall explain how you can set the defaults for Effects.
  1106. Setting the Styles
  1107. This is done as previously described. One thing to note is that if you select H1 or H2 (such as for the Main Heading) you will see that 'none' and 'NC' also become selected. Similarly if you choose H4 for something (such as Sub Heading) you will see that 'none' and 'I' are automatically set. This is because these options are included as part of the definitions for these items.
  1108. Saving the file
  1109. Saving is done by just clicking on 'Save'. A default filename of 'NewFile' will have been placed in the filename icon when you start a new Mappings file, and you would normally alter this first. You should also remember to 'un-tick' any Styles that won't have HTML equivalents first.
  1110. If you now click on the menu icon you should see your new file listed.
  1111. Style 'culling'
  1112. The Mapping window can accommodate only 14 Styles to map to HTML tags. This would normally be more than enough, since you wouldn't often create more than 14 distinctive Styles in an Impression document. However, it is possible, especially where you have a number of variations on the base Style with different rulers or where your standard document layout includes a lot of Styles, only some of which are used in the document to be converted.
  1113. If there are more than 14 Styles in a document then when you drag the TextStory to Imp-HTML it will open a window showing all the Styles in the TextStory.
  1114.  
  1115. Select the Styles you want to use and leave the ones that either aren't used in the document or which cannot be given any meaningful 'translation' into HTML unselected, then click on 'OK'. The selected Styles will be transferred to the Mapping window, the Abridge Styles window will close and you can proceed exactly as previously described.
  1116. Appendix
  1117. This sections contains information on the various files used 'internally' by Imp-HTML and explains how you you can alter these to suit your own requirements.
  1118. Setup files
  1119. These can be found in the sub directory 'Setup' of the Imp-HTML application directory. In here you will find five files, they are;
  1120.   CharMap
  1121.   D_Effects
  1122.   Effects
  1123.   Preamble
  1124.   Styles
  1125. CharMap
  1126. This is a list of ascii characters and the characters or strings of characters they will be converted to in HTML. Each line has the character and then a Tab character (ascii 9) followed by the HTML equivalent. If you load this file into a text editor it should look something like this.
  1127.  
  1128. The appearance of the Tab character, shown as a right pointing arrow here, will depend upon which text editor you use.
  1129. If you are familiar with HTML you will recognise these. For example, the 'sexed' double quotation marks are translated into " the pound character into £:, the < and > characters into < and > and so on. You can modify or at to this list if you wish.
  1130. D_Effects
  1131. This is the list of Effects that will be used if you click on 'Default' in the Effects section of the Mapping window. It consists of four lines, one each for Bold, Italic, Underline and Centre, in that order. On each line is, first, the tag used to switch the effect on, then a Tab character, then the tag used to cancel the effect.
  1132. If you examine this file in a text editor you will see that there is a space after the 'cancel' tags for each of the first three. This is because when you double-click on a word in Impression to highlight it and then make the word bold, italic or underlined, if the word is followed by a space Impression also includes the space in the Effect. For example, if you make a word bold in this way in Impression then the 'cancel bold' command will actually be placed after the following space. For some strange reason in HTML spaces before a 'cancel' are ignored, so -
  1133.   This is Bold and this isn't.
  1134. will become, in HTML
  1135.   This is Boldand this isn't.
  1136. To avoid this a space is placed after the 'cancel' tag. This can sometimes mean that you get a spurious space, for example, between a word and a full stop or comma, but even if you don't bother to weed these out they are much less common and less offensive to the eye than the 'joined up' words illustrated above.
  1137. Effects
  1138. This defines the Effects menu.
  1139. Each line in the file creates a line on the menu. First there is the name (no more than 12 characters) as it will appear on the menu. This is followed by a Tab character, then the code to turn the effect on, another Tab character, and the code to turn the effect off. The illustration shows the default file and menu and you can see how the two relate.
  1140.  
  1141. You can, of course, edit or add to this file to suit your own preferences.
  1142. Preamble
  1143. This will be used as the first part of any HTML created. It can contain anything you like, as long as it's valid HTML. The default Preamble file is shown below, and this is extremely basic.
  1144.  
  1145. Styles
  1146. This creates the Styles menu. Normally this would be a bit longer and more complicated that the Effects file, but it follows the same pattern. On each line is first the name as it will appear on the menu (no more than 12 characters), a Tab character, then the 'on' code, another Tab character, then the 'off' code.
  1147. The standard file, and the menu, are shown below.
  1148.  
  1149. You will see one obvious difference from the Effects file. Some of the first entries have another Tab character and field after the 'off' code. This is used to force the settings of the buttons that set the end of line mapping and whether the Style starts a new HTML chapter or appears in the Index. Five letters are recognised, and these can be on their own or paired. They must be in upper case, and are -
  1150.   I - Include anything in this Style in the Index fil
  1151.   C - Start a new Chapter when you find this Styl
  1152.   N - Set the the end of line button to 'none
  1153.   B - Set the end of line button to 'br
  1154.   P - Set the end of line button to 'p
  1155.  
  1156. The 'Colour Red' entry is really only included as an example of how you can use this menu to make your headings and sub headings coloured if you wish.
  1157. !Imp-HTML is Copyright © David Holden 2002.
  1158.  
  1159.  
  1160.  
  1161. ÿÿÿÿVOLUME3/ISSUE4/MODULES1/INDEX.HTM Volume 3, Issue 4, Modules for Beginners
  1162.  
  1163.  
  1164.  
  1165. Modules for Beginners, Part 5: Claiming Vectors
  1166. Brian Pickard
  1167. (This is being re-printed from the last issue as the second half of the article went AWOL for some still unknown reason - ED).
  1168. Most operating systems use vectors. In RISC OS quite a few of the SWIs use vectors. This means the vectored SWI does not jump directly to its routine held in the OS ROM but RISC OS looks up a memory address held in RAM (this RAM address is the vector reserved for the particular SWI), and jumps to that routine. Usually the address held in the vector is the standard ROM routine.
  1169. A designer of a module can claim a vector so that any vectored SWI can then jump to a different routine, hence altering the code for the SWI.
  1170. The new routine can do one of the following:
  1171. Totally replace the original ROM code, in which case control is then passed back to the caller of the SWI
  1172. Do some processing then call the ROM code
  1173. Call the ROM code then do some processing before control is passed back to the caller of the SWI
  1174.  
  1175. If the new routine replaces the ROM code this is known as intercepting the call, otherwise it is known as passing on the call.
  1176. Vector Chains
  1177.  
  1178. So far I have been a little simplistic in the explanation of how vectors hold addresses. It is more accurate to visualise a vector as the start of a structure which contains pointers to the next claimant of the vector. This structure holds both the address of the start of the code and a pointer to the workspace for the code.
  1179. Because the vector is a structure, more than one routine can claim the vector. The claimant does not have to remember the previous owners address.
  1180. Vectors than be claimed and released by many pieces of software in any order. The last claimant of a vector will be the first to have its routine called, then the next most recent claimant and so on. If any of the claimants intercept a vector then all claimants more recent than this one will have there routines called, but none after this one. See the following examples.
  1181. Here there are 2 claimants both of them passing on the call.
  1182.  
  1183. If a 3rd claimant now intercepts the call then the following happens.
  1184.  
  1185. Notice how this claimants interception causes a 'short circuit' so that none of the previous claimants routines are called.
  1186. If a 4th claimant who passes on the call is added the following would occur.
  1187.  
  1188. How to Claim and Release Vectors
  1189.  
  1190. There are two SWI's to Claim and Release vectors called, not suprisingly, OS_Claim and OS_Release. They use registers R0 to R2 as follows.
  1191. R0 = the vector number (each vector has a unique number
  1192. R1 = contains the start address of the code of the claiming or releasing routin
  1193. R2 = value to be passed in R12 when the routine is called (usually a pointer for workspace)
  1194.  
  1195. So to Claim the Mouse vector (number &1A) the following code is added in the modules initialisation.
  1196.   MOV R0,#&1A             ;mouse vector numbe
  1197.   ADR R1,routinestartadd% ;start address of routin
  1198.   MOV R2,#0               ;R12 would have the value 0 in this cas
  1199.   SWI "XOS_Claim"         ;call the SW
  1200. ,
  1201. To release the routine from the vector the same lines are used for R0 to R2 but then call SWI "XOS_Release".
  1202. An Example
  1203.  
  1204. In the following example the event vector is claimed. This vector is a little more complicated in that it is called whenever an event takes place. Events are generated by several devices, including the keyboard (whenever a key is pressed or released). So using this event we can check what key has been pressed or released.
  1205. Each event is numbered the keyboard event being 11 (another useful event is number 10 the mouse button change event). Look at PRM 1-152 onwards for the complete list of events.
  1206. To claim this event the following code is used.
  1207.   MOV R0,#&1A         ;mouse vector numbe
  1208.   ADR R1,eventstartadd%   ;start address of routin
  1209.   MOV R2,R12          ;R12 would have the value of R12 (modules workspace
  1210.   SWI "XOS_Claim"     ;call the SW
  1211.  
  1212. The routine looks at which key has been pressed or released:
  1213. .eventstartadd
  1214.   STMFD R13!,{R4,R14} ;push R4 and R14 onto stac
  1215.   LDR R4,ctrlchk%     ;look at value of ctrlchk fla
  1216.   CMP R4,#0           ;has it been set i.e. has *EventClaimon been issue
  1217.   BEQ passon%         ;if not (or *EventClaimoff has cancelled it) then pass o
  1218.   CMP R0,#11          ;R0 contains event number if not 11 then pass o
  1219.   BNE passon
  1220.   CMP R2,#&61         ;R2 contains the INTERNAL KEY number &61 is th
  1221.   BNE passon%         ;right hand CTRL ke
  1222.   CMP R1,#0           ;is this a key release actio
  1223.   BNE passon%         ;if not then pass o
  1224.   SWI 256+7           ;make a bee
  1225.   .passon
  1226.   LDMFD R13!,{R4,PC}  ;restore R4 and return i.e. passon the vecto
  1227.  
  1228. Note to pass on the vector to the previous owner, use the standard return MOVS PC,R14 or use the stack to load R14 into PC as in the above example. RISC OS placed the previous owners address in R14 on entering the routine.
  1229. The above example just makes a beep when the RH CTRL key is RELEASED. You must issue *EventClaimon command to activate this action. This is just done to show how vector routines can stay in the vector chain even if they do nothing. *Event Claimoff switches off the action. The module is called VClaim01 and the full source code VECTMOD1.
  1230. Reading a Vectored SWI's Parameters
  1231. Some SWI's just return values in registers. It would be convenient if these values could be read or altered in the vector routine before the SWI returns its call to the calling program. But so far the example can only be used to alter or read values before the vector reaches the ROM routine. What is required is the routine to set up a return address within itself before it passes on the call to the next owner. This return address would then be used by the ROM routine instead of the usual return to the calling program.
  1232. To do this is a little involved consider the following:
  1233. On entering a vector routine the return address of the previous owner is in R14. The return address of the calling program is already on the stack so when intercepting a vector call LDMFD R13!,{PC} is used to return to the calling program. The ROM routine always intercepts its vector.
  1234. Our vector routine must push onto the stack a return address after the calling programs return address. The ROM routine will intercept the vector and pull our address off the stack and therefore return to our routine. Any reading/changing of values can then be executed before our routine finally pulls the calling programs return address off the stack and thus return to the calling program.
  1235. At first the following might work;
  1236.   STMFD R13!,{R12,R14} ;store R12, and the next owners return address on stac
  1237.   MOV R12,R13          ;store present value of stack in R1
  1238.   STMFD R13!,{PC}      ;store the value of PC+12 (offset due to pipelining
  1239.   MOV R0,R0            ;padding out command because of pipelinin
  1240.   LDMFD R12,{R12,PC}   ;pass on the call to next owne
  1241.   .returnsfromROMtoher
  1242.                        ;do any required code on register value
  1243.   LDMFD R13!,{R12,R14,PC} ;restore R12 and R14 and returns to calling progra
  1244.  
  1245. The above code works only for non StrongARM CPU's because StrongARM architecture makes PC point to PC+8 not PC+12 when using STR or STM. So for a StrongARM CPU the following is required:
  1246.   STMFD R13!,{R12,R14} ;store R12, and the next owners return address on stac
  1247.   MOV R12,R13          ;store present value of stack in R1
  1248.   STMFD R13!,{PC}      ;store the value of PC+8 (offset due to pipelining
  1249.   LDMFD R12,{R12,PC}   ;pass on the call to next owne
  1250.   .returnsfromROMtoher
  1251.                        ;do any required code on register value
  1252.   LDMFD R13!,{R12,R14,PC};restore R12 and R14 and returns to calling progra
  1253.  
  1254. The MOV R0,R0 is not required. There is a neat way round this problem. From RISC OS 3.7 onwards SWI "OS_PlatformFeatures" was included. Calling this in the modules initialisation will show which CPU is in the computer. On return if bit 3 of R0 is set then the CPU stores PC+8 in any STR or STM command otherwise the CPU stores PC+12.
  1255. In the example module called VClaim02 (source code VECMOD2) this is done together with the following code which applies to the Mouse vector.
  1256.   STMFD R13!,{R12,R14} ;store R12, and the next owners return address on stac
  1257.   LDR R12,strngarm%    ;see what this flag contains if 0 then not StrongAR
  1258.   CMP R12,#0           ;its value was set in the modules initialisatio
  1259.   MOV R12,R13          ;store present value of stack in R1
  1260.   STMEQFD R13!,{PC}    ;store the value of PC+12 (offset due to pipelining
  1261.   STMNEFD R13!,{PC}    ;store the value of PC+8 (StrongARM CPU
  1262.   LDMFD R12,{R12,PC}   ;pass on the call to next owne
  1263.   .returnsfromROMtoher
  1264.                        ;do any required code on register value
  1265.   LDMFD R13!,{R12,R14,PC};restore R12 and R14 and returns to calling progra
  1266.   
  1267. The full source code produces a beep when any of the mouse buttons are pressed when *EventClaimon is issued.
  1268. Final Example
  1269. This claims both the event vector for the keyboard event and the Mouse vector to alter mouse button settings. The source code is in the file VECMOD3 and the module is called VClaim03. This allows the user to press the LEFT ALT key (beep heard) which then modifies mouse vector routine to always have the left mouse button pressed. This produces the effect of having a permanent drag! Pressing LEFT ALT again (beep heard) cancels the effect. The source code is fully annotated.
  1270. Well that its for this time, a bit more involved, next time I will show ways in which modules can communicate with BASIC programs and vice versa.
  1271.  
  1272.  
  1273. ÿÿÿÿVOLUME3/ISSUE4/MODULES2/INDEX.HTM Volume 3, Issue 4, Modules for Beginners
  1274.  
  1275.  
  1276.  
  1277. Modules for Beginners, Part 6: Communicating with Programs
  1278. Brian Pickard
  1279. Most modules send data to programs by the use of their SWI’s or star commands, as demonstrated in earlier parts of this series. However sometimes a module is required to check for events happening as described in the last issue. Since these can occur at any time star commands and SWI's cannot be used. It would be nice if this type of module could signal the events it is checking for to a program. The program could then take appropriate action, even if it is only a warning message.
  1280. Wimp Poll Word
  1281. There is a simple way of doing this using the wimp poll word. This is an extension to the normal Wimp Poll SWI. When this extension is active the wimp returns event 13 (pollword) when the poll word contents become non zero. This occurs before any screen redrawing occurs. The wimp mask word must have bits 22 and 23 set to use the poll word and R3 must point to the poll word.
  1282. In the following the pollword variable is pollword% and the wimp block is bk%.
  1283.    mask%=(1<<22)+(1<<23
  1284.    SYS"Wimp_Poll",mask%,bk%,,pollword% TO action
  1285.  
  1286. To deal with the wimp pollword event the following code is required.
  1287.    CASE action% O
  1288.    
  1289.    
  1290.    
  1291.    WHEN 1
  1292.    !pollword%=
  1293.    REM do required actio
  1294.    
  1295.    
  1296.    ENDCAS
  1297.  
  1298. The pollword contents must be made zero since the wimp will continue to issue event 13 causing an infinite loop. If the value of the pollword is required the wimp conveniently stores this at bk%+4 (bk% being the wimp block). The poll word can be any word aligned memory location within the module area. The modules workspace pointer is a convenient location. This can be found by using the following OS_Module SWI
  1299.    SYS"OS_Module”,18,"module_name" TO ,,,,pollwordcontents%;flag
  1300.    IF (flag% AND1)>0 THEN ERROR 0,"Module module_name cannot be found
  1301.    =(flag% AND1
  1302.  
  1303. Keyboard checking Example
  1304. I have used the keyboard checking module with just minor changes. Eight bytes of workspace are reserved for the pollword and key code. In the key press event detection code the key up/down returned in R1+1 is placed in the first word (pollword) ready for the Basic program to detect and report when the key is pressed. We need to add one to R1 so that both key up and down events will make the pollword non zero.
  1305. The key code in R2 is placed in the second word so the Basic program can work out the key. The Basic program then opens a window and reports which key, if any, is pressed. To make sure the Basic program can find the pollword contents the OS_Module SWI is called in the null event code just in case the RMTidy command has been issued and the workspace has been moved. In the module the following code is executed when a key press event happens.
  1306.    .eventv
  1307.    STMFD R13!,{r1 ,R4,R14} ;store required register on stac
  1308.    CMP R0,#11              ;is this event a key pres
  1309.    BNE passon%             ;if not then pass on the even
  1310.    STR R2,[R12,#4]         ;store the key code at workspace+
  1311.    ADD R1,R1,#1            ;add one to the up down fla
  1312.    STR R1,[R12]            ;store at workspace (which is the pollword posn
  1313.    .passon
  1314.    LDMFD R13!,{r1 ,R4,PC}  ;restore the registers and pass on the even
  1315.  
  1316. In the BASIC program the following code is executed when the pollword becomes non zero:
  1317.    pollword%!0=0     :REM cancel pollword back to zer
  1318.    keyup%=bk%!4-2    :REM store value pollword-2 in a flag to see
  1319.                      :REM if key up or dow
  1320.    keycode%=pollword%!4 :REM Store keycode for printing in windo
  1321.    IF keycode%@lt;&68 THEN :REM If the key code from the keyboard se
  1322.                                 (Programmers Ref Manual 1-156
  1323.    bk%!0=wdh%:SYS&400C6,,bk% :REM Then close reporting windo
  1324.    PROCopen(wdh%)     :REM Reopen it to force updat
  1325.    ENDI
  1326.  
  1327. The above code could be cleaned up but it works well enough for a demo. The application is called !Keybrdchk. I have included the source code for the module (Keymodsrc).Well thats it for this time, next time I will round up the series with an over view of all the topics, unless there is anything you the reader would like to know about modules!
  1328.  
  1329.  
  1330. ÿÿÿÿVOLUME3/ISSUE4/NETWORKS/INDEX.HTM Volume 3, Issue 4, Networking
  1331.  
  1332.  
  1333.  
  1334. Networking
  1335. Richard Walker
  1336. Networking series Part6 : A low cost router
  1337.  
  1338. Richard Walker
  1339.  
  1340. This time, we are going to look at setting up a low-cost software router device for sharing one Internet connection between a number of other computers over a network.  The theory behind this was discussed in detail in the previous article.  Various types of Internet connection can be shared with such a router.
  1341. Dial-up options
  1342.  
  1343.  
  1344. Broadband options
  1345.  
  1346.  
  1347. Note that if you have a device that connects to an ISDN or ADSL socket, and then directly into an Ethernet network, it may include built-in connection sharing features. If not, you can connect it a router, just like anything else.
  1348. Also, it may sound crazy to share a plain 56k dial-up modem connection, but it's actually quite practical. Remember that each computer won't necessarily want to use the full 56k bandwidth all of the time. Internet activity is often in bursts – consider that you might wait for a web page to download, but then spend a few minutes reading it.
  1349. To visualise the concept of such a router, study figure 1.
  1350.  
  1351. Note that in the case presented in figure 1, the Internet connection is provided by a cable modem which connects itself to the router via Ethernet. This could just as easily be USB - indeed, many cable and ADSL modems connect via USB. Getting slightly more complicated, the connection could also be provided by a standard 56k modem, connected via the serial port.
  1352. The slightly more tricky bit to visualise is that the router's WAN network interface card and the modem could be provided on one single card, so we would end up with something like figure 2.
  1353.  
  1354. Note that the ISDN interface card provides the ISDN-specific hardware (equivalent to the kind of thing a cable or ADSL modem does) and it also appears as a standard network interface card. It's an all-in-one solution.
  1355. Logically, the exact same scenario is possible with a standard 56k PSTN modem card: the 'WAN interface' will be either a serial /USB port (for connecting an external modem) or an internal PCI/ISA modem card. Although you may not think of these as 'network cards', for the purposes of routing, they are!
  1356. Obviously, PSTN and ISDN dial-up solutions are not always connected (unlike broadband) so the router would have to have some kind of connection control - just like the connect/hangup functionality provided by the ANT Internet Suite or R-Comp's DialUp. Many dial-up routers can be configured to dial on demand ('demand-dial') within certain times of the day (e.g. at evenings) or week, and can automatically disconnect after a period of inactivity (e.g. five minutes).
  1357. The router itself
  1358.  
  1359. The principal component of the router is an old 486/Pentium PC. Note that it doesn't have to be old, but there is simply no point in using anything modern for the simple task of routing – it's a waste of processor power. It's quite possible to come across a 486 or low-end Pentium (between 60 and 233 MHz) sitting gathering dust in a cupboard in a local school or business, or even in a skip! (Yep - thats where a lot of my stuff came from -ED). It is desirable to stick to systems that have PCI slots rather than the ISA or VLB – they are far easier to configure!
  1360. As a bare minimum, you will need a base unit with a working power supply, motherboard, processor and RAM. If you come across a number of similar machines, it might be a good idea to grab the RAM from several, so you can have more in the one machine you take. Other essentials are a floppy drive and keyboard, but you may be able to get these from elsewhere.
  1361. Study figures 1 and 2, and decide if you need one or two Ethernet cards - it depends on your equipment. If you need two, it is absolutely fine to install two of the same make and model, or two completely different cards.
  1362. The first network card will connect to your local area network (which is probably Ethernet). The second will connect to the hardware that provides your Internet connection.  If your PC didn"t come with network cards then you can always purchase one or two – new ones can be had for less than £10 each. Go for NE2000-compatible PCI cards, preferably a model with 10/100baseT and 10base2 (for maximum flexibility). RealTek RTL8029 cards are particularly common, and I have used them many times without a problem.
  1363. A note on TCP/IP
  1364.  
  1365. It's assumed that your have a local area network already set up (see the advice in previous articles). The router will obviously require it's own IP address and hostname, and must be configured so it fits in with your own addressing scheme. For example, my own network is illustrated in figure 3.
  1366.  
  1367. If you forget about the router and the cable modem, there is a fully-functional TCP/IP network there. It it possible for each computer to communicate with another one for the usual network activities (file and printer sharing, playing games, sending messages etc.). The router adds Internet access to the computers already on the network.
  1368. PC cleaning and building
  1369.  
  1370. It is always a good idea to give the computer a strip-down, thorough clean, and re-build – they are usually full of dust!  In addition, you might wish to discard some parts (e.g. such as sound cards), as they are not needed, and it makes sense to have as little as possible fitted. When you switch the machine back on, it's a good idea to load the default BIOS settings (this is equivalent to a DELETE-power-on on a RISC OS machine) and check things like the time are correct.
  1371. PC-based routing software
  1372.  
  1373. There are two kinds of software that you can install to actually perform the routing on this computer: single-floppy or hard disk based. The latter will be have extended functionality, such as extra logging and optional services (e.g. a caching proxy server or web server). If you want such extra functionality, then the computer will obviously need a hard disk - otherwise, you can run the computer without one. The advantages of not using a hard disk include: less moving parts and no worries about unexpected power losses.
  1374. Freesco is a popular single-floppy disk system. See 
  1375. Both Freesco and SmoothWall are actually based on Linux. They use a cut-down kernel and the bare minimum of required tools to get a system up and running, all of which is surprisingly compact (around the size of a floppy disk in the case of Freesco). SmoothWall has a number of extras such as a caching proxy server, dynamic DNS clients, and support for more exotic routing and logging.
  1376. The router software is freely available, and to get it onto your router computer, you need to download a 'disk image' (from the Internet) which is then written to a real floppy disk. You can do this with another computer running just about any operating system (even RISC OS!).
  1377. Freesco actually works from this floppy disk. The router PC will boot from it, and use it for everything. SmoothWall uses two floppies, but they are only used to for the basic installation (a CD ROM or network connection is required for the remainder), and the PC will boot from and use the hard disk in general.
  1378. So, with the right PC hardware all connected up, you can insert a Freesco floppy disk. The PC should boot from there and take you to a configuration walk-through system.  I will cover this in more detail next time.
  1379. Simpler router software?
  1380.  
  1381. If all this sounds too technical, there are router programs available for Windows, if you would rather install that on your router PC (this does raise the minimum hardware specification, though!). Windows 98SE, Me, 2000 and XP include 'Internet Connection Sharing'. This just requires a few clicks in Control Panel to setup, and if you are unsure, Windows Help will guide you through it. ICS works in exactly the same way as Freesco and SmoothWall (NAT) but it does seem wasteful to have a whole Windows licence and installation just for routing!
  1382. You could, of course, use one of your general-purpose Windows PCs (if you have one!) as a router in addition to it's current tasks. ICS runs in the background, and doesn't use much in the way of system resources. Therefore, when the Windows PC is switched on, the RISC OS machine will be able to use the Internet connection. If you tend to have your Windows machine switched on for most of the time that the RISC OS machine is switched on, then maybe you could get away with this kind of arrangement.
  1383. Client-side configuration
  1384.  
  1385. Once the router is correctly configured, the other computers on the network need to be made aware of it. Thankfully, this is simple. We simply need to tell them that non-local computers (i.e. the Internet!) are reachable via our router, and ensure that domain name lookups work.
  1386. On a RISC OS 3.7 or 4.0 computer, the procedure with Boot/Configure is:
  1387.     Double-click Boot to start Configure
  1388.  
  1389.     Click Network
  1390.  
  1391.     Click Internet
  1392.  
  1393.     Click Routing
  1394. Set the gateway to the IP address of your router Click Set then Click Hostnames. Set the primary name server to the IP address of your router Select 'Use name servers also' Click Set Click Close and re-boot as suggested Run Browse (or whatever) and check that you can reach a machine on the Internet (e.g. go to http://news.bbc.co.uk).
  1395. You can also connect to the computer running Freesco or SmoothWall with a terminal program (such as Nettle) and/or a web browser (such as Fresco). This will show you the system status, and allow you to make configuration changes and perform tasks such as re-booting or shutting down. Therefore, you can run the router without it's own keyboard and monitor most of the time. OK, so it's not quite as elegant as a dedicated hardware router, but it's much cheaper!
  1396. Why not use old Acorns?
  1397.  
  1398. You may be wondering why an old PC was used for this task, rather than an old Acorn machine (e.g. an Archimedes 310). The reasons for this are simple: hardware cost/availability and software suitability. On the hardware front, an Ethernet, USB or high-speed serial card for an A310 is very expensive. Also, RISC OS doesn't have the required TCP/IP routing software – this was only provided by FreeNet 2.0 (a freeware alternative to Acorn"s TCP/IP modules, back in the days when Acorn"s cost £199) which was never released beyond alpha/beta status (Acorn decided to freely release their modules!).
  1399. In theory, you could install Linux on an old Archimedes, and so long as appropriate drivers existed for your network interfaces, it would work. This would require a pretty massive effort, as the standard editions of Freesco and SmoothWall would not support such a configuration. Only a true Acorn die-hard would consider it!  Actually, I'd be interested to hear from anyone with such a setup!
  1400. Signing off
  1401.  
  1402. Next time, we will look at the configuration side of Freesco or SmoothWall in more detail, and explain a little more about what they can do. In the mean time, their web sites are an excellent source of information. As usual, please get in touch with The Editor or myself if you want to make suggestions or raise queries regarding this series.
  1403. Richard Walker
  1404.  
  1405. ÿÿÿÿVOLUME3/ISSUE4/NTUSER/INDEX.HTM Volume 3, Issue 4, NTUsers2
  1406.  
  1407.  
  1408.  
  1409. NTUsers2
  1410. Mike Choo has been sleeping with the enemy
  1411. Windows NT Servers, and more latterly Windows 2000 servers, have been making inroads into schools which had previously been using Acorn level 4 or Advanced level 4 fileserver software. With it, it brings all the vagaries of Windows and a complex set of options for network managers to deal with.
  1412. One limitation for organisations with a large number of users is that NT itself is not very user friendly for setting up such numbers of users. Typically NT would have been originally designed for small businesses with a relatively small number of users, say 30 or so, where the users would be set up using NT"s "User manager for domains" application with a whole array of often unneeded options.
  1413. However, setting up a thousand or more users in a school this way would take literally days even though most users would need similar attributes e.g. depending on whether they were pupils or staff. Enter, to the rescue, Atomwide with their NTUsers package which initially ran only on an Acorn (with RISC OS 3.5 or later) in conjunction with the Datapower database with the ironic result that you would need at least one user friendly Acorn to help set up a Windows network on an NT server! This package was designed from an experience of Acorn networking which would help it to make using NT more friendly in the manner of how Level 4 had been for years.
  1414. NTUsers2 developed from the original application with a range of features that extends on the original version though sensibly (though in a way sadly) in a cross platform version in that it is a Datapower2 database. Hence it should work with any platform version of Datapower 2 (version 2.15 or later), Acorn, PC or Mac, including with the free Datapower reader downloadable from the Iota web site at www.iota.co.uk.
  1415. Setting up users with NTUsers
  1416.  
  1417. Whatever client stations you have connected to an NT/W2000 server, each user must be created with their own user name, password and various other optional attributes. While the built in User Managers enable you to set up users one at a time, when you have many users to set up this is simply too time consuming.
  1418. Basically what NTUsers does is to take a CSV file (comma separated values – comma delimited text file) or TSV file and do all the donkey work for you in creating a batch file (a kind of PC obey file) which will then set them up and give them the attributes you have chosen from its available options.
  1419. Many schools use the SIMS (School Information Management System) administration software, or an alternative similar system, to keep details of pupils on record. From this it is possible to extract data in CSV format so one could get typically the surname, first name and year of entry as a minimum set of data. The reason for choosing year of entry rather than which year they are currently in is that it stays valid for their whole school life whereas the year they are in changes each year and would give tedious administrative problems in that all users would need to have certain details changed each time they changed year.
  1420. Initial options
  1421.  
  1422. NTUsers is a pre-prepared Datapower 2 database into which this data file can be imported and manipulated whereas its predecessor was a combination of a Datapower database and a separate application. A preliminary screen allows the setting up of default parameters such as the name of the server and the drive where users' directories are to be placed. Each user will have their own directory and it is usually an advantage that this is a "hidden" share so others cannot see that it is there. The choice is given as to whether they are to be hidden or not and also as to whether users can change their passwords. It may be that a network manager would want pupils to be able to change their passwords as a security measure or they may prefer that they cannot so they can use initial records to give the pupil another copy of their password when they forget their own, which they regularly do.
  1423. Importing and processing data
  1424.  
  1425. Initially the database must be emptied of any existing records and the CSV file can be imported by dragging it onto the tool bar of the appropriate database layout and matching the items in the CSV file to the database fields.
  1426. Once the data is imported various actions can be undertaken by clicking on buttons which activate Datapower scripts. The main users set up layout allows generation of user names by double clicking on the appropriate button. User names are typically constructed from the last two digits of the year of entry and a combination of letters from the surname, their first name initial and a number. NTUsers will also check that no users have been given duplicate names. If desired the generated user names can be cleared and redone.
  1427. There are a variety of options for setting passwords, each user can be given their own, or a uniform password allocated to everyone as a temporary measure until they each change their own to their own unique choice. If each user is to have their own password set by NTUsers then such a password can be a random selection from a pre-set editable list or can be a randomly generated unique one. Using the pre-set list gives passwords which are easier to remember but might be guessable if the default list of 26 words is used and pupils compare passwords. A unique randomly generated password is more secure but can be difficult to remember, particularly as it is likely to consist of both upper and lower case characters. It is useful, then that NTUsers gives alternative options and if you change your mind you can clear one set of passwords and replace them with an alternative set.
  1428. Once all the users have their user names and passwords to your satisfaction a batch file can be created. This can be a batch file that will set up the root directory for the users" directories to reside within, normally called Users with sub directories for each year of entry. This would normally be the choice for the very first time users are set up on a server. Alternatively, if the users are additions to a set of existing users then only the instructions needed to set up the users, their directories etc are included. This does mean that if a completely new group e.g. a new year"s entry are being added that the sub directory for the year of entry within the main users directory must be created manually. A third option is to generate a batch file that will remove a set of users. This might be useful where a complete set of pupils leaves school. The NTUsers database can be searched to select just that year and then a batch file with the commands to remove the users can be generated.
  1429. Once a batch file has been created it is transferred to the server over the network or via floppy disc; double clicking on it will then set up the users with the chosen attributes. Depending on the speed of the server hundreds of users can then be set up in a matter of minutes. I timed a batch of around 80 users at about 15 seconds on a Pentium P2 400. One little glitch is that the batch file created is called NTSETUP.BAT which when generated on pre RISC OS 4 Acorns will truncate to NTSETUP/BA as only 10 characters can be used in a file name. This means you have to rename it on the server or a PC formatted floppy to restore the BAT suffix, an unexpected irritation considering how well the product is designed otherwise.
  1430. To help inform pupils of their individual user details there is a facility to print these from another layout accessible by clicking on an icon on the screen. These can then be cut into individual slips.
  1431. Changes compared to the original NTUsers
  1432.  
  1433. The newer version has a number of improvements. With the previous version, when you added an extra batch of users there was always the need to manually check the user names generated against existing users or to add the new users" CSV/TSV file into the existing database of users with the danger that regenerating all the usernames, so they can be checked against one another, might cause anomalies under certain circumstances. Now that user names start with the last two figures of the year of entry a new cohort of pupils can be added independently with the confidence that they will not duplicate user names of those in other years.
  1434. More options are given regarding passwords, the earlier version assigning the same default password to everyone unless they already had different ones contained in the original CSV/TSV file. Now passwords can be allocated from a list and also be randomly generated obviating the need for all pupils to have to set a new password straight away if they just had a default one which everyone knew and afforded no security. This makes it easier for a teacher to set a password which cannot be changed so that in the event that a pupil loses or forgets the password they can remind them from a list (which, incidentally, can be easily printed from NTUsers) rather than have to go to the server each time and change it from there. Since the list of preset passwords is editable a teacher can put in any number of their own choice.
  1435. The earlier version required about 20 processes of dragging and dropping between the NTUsers Datapower database and its companion application. This version is much simpler to use or re-use if you change your mind about something part way through as I changed from listed passwords to random ones just by clearing one set and generating the next, each action involving double clicking on a button. There are also more varieties of batch file that can be processed.
  1436. The one major loss from the previous version is that the newer one will not process the creation of script files. Basically, the script files that were made in the original were individual "boot" type files which would be run at logon, one for each user. These files would only be run by PC clients not Acorns but if the Acorn clients were used with Atomwide's NTFiler, for instance, they could do something similar anyway. The default script that was generated did just two things although more could be added if desired. One just set the clock on the client from the time on the server but the second did a really useful thing of helping access to the user"s network area by putting an access icon in My Computer. .
  1437. The new version of NTUsers leaves you to produce any script files you want though it will allocate a script to each user for you, assuming you give the filename of the script even if that script does not yet actually exist. It does also allow more options regarding scripts, allowing you to set a single one for everyone to use, or one per year group or one per user but in each case you have to produce your own script file(s). By setting everyone to use the same script you only have to produce one but that means you have to know how to write scripts. Hence if you want an icon for a user's home directory in My Computer that means knowing how to get the syntax correct. I have also had one report from a school of problems when a number of users logging on simultaneously all used the same logon script causing them to revert to individual scripts.
  1438. If you want one per user as with the old version then for 200 users you will need to create 200 scripts manually! Alternatively, if you have the older version, you can do as I did and after creating all the users, passwords etc, export the data in CSV format back into the original NTUsers and whizz through the processes to have it create the scripts for you – took me about 3 minutes for 80. That way I got the advantages of the new version and still got the individual scripts I wanted. So you may still need an Acorn to do the whole lot!!
  1439. Conclusion
  1440.  
  1441. This is an extremely useful kind of utility and one that I would recommend every NT/W2000 network manager to have as it enables whole batches of users to be set up so quickly and easily compared to doing it manually using NT"s User Manager for Domains. It is not a complete substitute for knowing how to set up users and directories as certain elements may still have to be set up manually but they are relatively small demands.
  1442. Being a Datapower database also leaves scope for personal customisation but only for those who really know what they are doing and generally it is unnecessary, in my opinion, unless you have a very specialist requirement. You do need to have a copy of Datapower 2 if you want to do any customisation otherwise you can use IOTA's free Datapower 2 run only application, downloadable from their web site.
  1443. The loss of the script making facility is a minor drawback and I would keep the original version for this reason but otherwise this version"s improvements have been very well thought out.
  1444. The latest version also has some facilities that relate specifically to the later Windows 2000 server though I have not fully tested these though I found that scripts I generated worked fine on W2000 as well as NT4.
  1445.  
  1446.  
  1447. Product details
  1448. Product:
  1449. NTUser
  1450. Supplier:
  1451. Atomwid
  1452. Price:
  1453. £99 (ex VAT) for a single installation
  1454. Address:
  1455. Unit 7, The Metro Centre, Bridge Road, Orpington, Kent BR5 2B
  1456. Tel:
  1457. 01689 81450
  1458. WWW:
  1459. E-mail:
  1460.  
  1461. Note that it is necessary to have at least a single user copy of Datapower (v 2.15 or later) from Iota Software in order to customise NTUsers.
  1462. Product details
  1463. Product:
  1464. Datapower
  1465. Supplier:
  1466. Iot
  1467. Price:
  1468. £149 (ex VAT
  1469. Address:
  1470. Iota House, Wellington Court, Cambridge CB1 1H
  1471. Tel:
  1472. 01223 56678
  1473. WWW:
  1474. E-mail:
  1475.  
  1476. Mike Choo
  1477.  
  1478. ÿÿÿÿVOLUME3/ISSUE4/PD/INDEX.HTM Volume 3, Issue 4, PD World
  1479.  
  1480.  
  1481.  
  1482.  
  1483. PD World
  1484. Paul Brett features the work of Jochen Lueg.
  1485. Its been a quite couple of months on the PD front. It would seem that all the normal PD, shareware and Freeware authors have been roped in to work on commercial projects of one sort or another. So instead of our usual pick and mix round up we are going to concentrate mainly on the work of one author. So this issue we are going to take a long hard look around 
  1486. ByJupiter
  1487.  
  1488. This program will only work on a RiscPC. (The version on the RISC World CD needs to be run in 32,000 colours). It supports interactive help via the Help application. At 
  1489.  
  1490. FSI Batch
  1491.  
  1492. FSI_Batch will convert any group of files that ChangeFSI understands and convert them according to the options selected. These options are much like in ChangeFSI. The converted files are stored in an internal directory, or a directory of your own choice if you prefer. The program will work with an A5000 as long as your version of ChangeFSI is a recent one (1.15 or later) and the SpriteExtend module is in the system directory. Just drop any group of images (not directories) into the window, set the options and click on convert. Sit back and watch in amazement. The program installs in the usual way. There is a single window, divided into three sections. As an added feature, FSI_Batch will now convert Acorn sprite files that contain more than one image. A handy feature which allows you for instance to get at the individual images of a multi sprite file very easily.
  1493.  
  1494. NoButton
  1495.  
  1496. Modern printers have all kinds of different functions which on a PC would be selected with a mouse from within the Properties window of the printer driver program. Some printers give access to these functions via the control buttons, but the sequences are tedious and hard to remember. My program enables you to perform most of these test functions with the mouse in the comfort of your chair (if indeed you are sitting down at the time!) At the moment supported printers are Canon S450, 2100, 4650, 7000, 7100 and 8200. In addition the Epson 750 Photo and Stylus 850 are also supported. It is up to the user to select the correct printer. Default is the Canon 4650, but the iconbar menu opens a small Epson 750 window. The !Printers application does not have to be installed when you use the program. The program is written in such a way that Jochen can easily update it for other printers. Drop him an 
  1497.  
  1498. NumberFix
  1499.  
  1500. Certain programs, Spacetech's !Photolink is one of them, output files numbered 1, 2, 3, 4, 5  .....  10, 11  and so on. !NumberFix was written to help with the manipulation of such files. Often one deletes some of the files and wants to renumber the sequence. Sometimes one wants to insert sprites at the beginning. To do this one has to renumber all the files to, for example, 31, 32, 33, 34. Often one wants to add extensions to the files, i.e. 12/jpeg. One might even want to call them  Hol_12/jpeg where 12 is the number of the file. When files are called 1, 2, 3, 4, 10, 12, the filer will list them alphabetically and 10 is in front of 2 and 3. This can only be fixed by renaming all single cipher number to 01, 02, 03 etc. All these operations have one thing in common - they are a pain in the neck. NumberFix was written to easy this neck pain considerably. It will do all the above operations with a click of the mouse.
  1501. Planets
  1502.  
  1503. The program demonstrates a three body planetary system. The mass of the first two bodies (yellow and red) can be adjusted with the bump buttons. Clicking 'Show map of known space' will display their positions and velocities. The program places all bodies in a stable orbit, though this can change as they interact. The parameters of the third body can be adjusted. In addition to the mass, its position and velocity can also be changed. The velocity of the planet is indicated on the map by the length and angle of the white line originating at the centre of the red planet. All the bump buttons increment by a small amount when using SELECT and by a larger amount when using ADJUST. The three 'Universe' buttons give different views of the same solar system. 'Normal' places two of the bodies at either end of the screen. 'Huge' puts them in the middle so that larger or very erratic orbits can be followed. Massive makes the place even larger. The three 'Mode' buttons display solid bodies, dot traces or a mixture of the two. This comes into effect as soon as 'Animate' is pressed. The 'Solid' button will display three coloured circles for the system. This option is very fast. The 'Trace' button will trace the orbits. This makes it easier to understand the mechanics of the system. This also is very fast. If both buttons are on, both traces and solid circles are displayed. The '3D' button displays three 3-dimensional spheres instead of circles.It also activates the name icons. Sprites of various well known celestial bodies can be made to ply their orbits. Galactic hitchhikers should experiment with this option, it might refresh some old memories as both whales and petunias are catered for. Pressing the 'Menu- middle' mouse button during an animation will return you to the desktop. Pressing the 'Select - left' button will pause the animation. In trace mode, pressing 'Adjust right' will clear the screen of all previous traces.
  1504.  
  1505. Target
  1506.  
  1507. This is a game Jochen wrote more than 16 years ago and it used to be very popular with his students. When he showed it to the current generation they became just as addicted, so he decided to let other people try it. The game involves firing a large gun - cleverly sited on a mountain - at ships of different sizes. A nasty balloon gets in the way and suitable insults are dished out to bad shots. The Risc OS version looks a bit better than the BBC version and uses sound samples. However, I've kept a deliberate 'BBC look'. It should work with any 32 bit Acorn computer in working order.
  1508. That's it from me for this issue. If you like the idea of featuring one particular authors work in the PD column then let us know, indeed if you think we might like to feature your software, or have a suggestion for who we could feature, then get in touch with the 
  1509. Paul Brett
  1510.  
  1511.  
  1512.  
  1513. ÿÿÿÿVOLUME3/ISSUE4/POWERBASE/INDEX.HTM Volume 3, Issue 4, Powerbase
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521. Using Powerbase - Part 4
  1522. by Derek Haslam
  1523. As promised in the last article, the main topics this month are:
  1524. Associating string operations and user functions with Computed field
  1525. Using subsidiary indexe
  1526. Attaching external files to database record
  1527.  
  1528. Before proceeding, however, there is an updated version of Powerbase
  1529. v.8.32 are minor but it's always best to use the latest version.
  1530. Using string operations in Composite fields
  1531. When a database contains the names of people we often want the names in differen
  1532. formats for different purposes. If the names supply the primary key of th
  1533. database the surname usually comes first. Something like the first 4 letters of th
  1534. surname plus the initial letter of the first name yields a suitable key for quickl
  1535. retrieving records. e.g. John Smith might have 'Smith' in a Surname field and 'John
  1536. in a First name field, the primary key being SMITJ, which serves to distinguis
  1537. John from (most) other Smiths. In an alphabetical list of names he would normally appea
  1538. as Smith John but if we're addressing a letter to him we would prefer a mode of address such as 'Mr. J. Smith', or perhap
  1539. 'Dr. J. Smith', 'Rev. J. Smith' or whatever is most appropriate.
  1540. To illustrate this we need a new database. You can use the empty databas
  1541. but you might care to get some more pratice using Powerbase by constructing i
  1542. yourself. Five data fields, the first four of which are Editable, will be needed:
  1543.          Class        Type           Descriptor      Tag   Data length
  1544.          Editable     Unrestricted   Surname         SNAM     2
  1545.          Editable     Unrestricted   First name      FNAM     2
  1546.          Editable     Unrestricted   Other names     MNAM     2
  1547.          Editable     Unrestricted   Title           TITL     
  1548.          Computed     Composite      Address as      ADDR     25  
  1549.  
  1550. That last field is very important; it will allow us to re-jig the name into 
  1551. format suitable for addressing a letter by making use of the data in the other fields
  1552. Just to make sure we get it right Fig.1 shows what the relevant part of the Fiel
  1553. design window should look like when defining the field:
  1554.  
  1555.  
  1556. Fig.1 Designing the Computed field
  1557. Make sure you have Composite selected as the field type, not Calculated.
  1558. The number of different entries in the Title field will be quite small so yo
  1559. might add a Menu button to facilitate entry. Can you remember how to do that? Th
  1560. field type will be found in the Extra button class, it's Menu (field), not Menu (General
  1561. and you give it the same tag (TITL) as the associated data field. No descriptor i
  1562. necessary.
  1563. Choose Default database from the main menu to create the empty database and put yo
  1564. into data-entry mode. Depending on how you've laid out the fields, your record windo
  1565. should look something like this:
  1566.  
  1567.  
  1568. Fig.2
  1569. If you did add the Menu button the next thing to do is construct the menu itself
  1570. Click SELECT on the button and it will tell you what to do. Be sure to change th
  1571. menu title to something other than 'UserMenu' or you'll always get a text windo
  1572. to edit when you click the button instead of an actual menu. Below the title enter 'Mr.', 'Mrs.', 'Miss'
  1573. 'Dr.', 'Rev.' etc., one to a line, then save the file with the supplied name.
  1574. Now for the Composite field. When the pointer is over this field it changes to 
  1575. large cross indicating that this is not an Editable field. (Remember the 'pocke
  1576. calcualator' pointer over the Calculated field added to the !Marks database last time?
  1577. What we want in the Composite field is the Title, followed by a space, then the initia
  1578. letter of the First name, followed by a full-stop plus a space, and finally the Surname
  1579. Click MENU over the Composite field and choose Formula from the Field submenu. Th
  1580. writable icon will show 'ADDR=' and the right-hand side of the formula should be complete
  1581. exactly as in Fig.3:
  1582.  
  1583.  
  1584.  
  1585. Fig.3 Entering the formula
  1586. The formula is quite a long one and isn't fully visible in the writable icon. The 'L
  1587. at far left is the final letter of TITL which comes immediately after the '='. The metho
  1588. used to strip the initial from FNAM will be familiar to anyone who has programmed in BASIC
  1589. the '1' after the comma means take the leftmost single letter of the field. The Fields
  1590. menu button on the Formula window may be used to enter the field tags when the caret is a
  1591. the appropriate place in the formula.
  1592. When you're sure the formula is correct click OK and you're ready to try it out. Notic
  1593. how the contents of Address as change when you type Return after adding each piece of data
  1594. (If you type Return after entering the Title a new record will be displayed because Title i
  1595. the last Editable field. To see the immediate effect of entering the Title type the up o
  1596. down arrow instead of Return.)
  1597. If you change your mind about how you want to address people you can edit the formula
  1598. Access the Formula window again, delete everything up to the '=' and enter a new right-han
  1599. side as in Fig.4:
  1600.  
  1601.  
  1602. Fig.4 Altering the formula
  1603. When you enter new records the contents of Address as will be the First nam
  1604. followed by Surname with a single space between. But suppose we want to change all th
  1605. existing records to this format? Nothing simpler! Go back to the Formula window, selec
  1606. the Recalculate existing records button and click OK. All the previously-entere
  1607. records will be changed to the new format.
  1608. User functions in Composite fields
  1609. Using such a format raises another point: som
  1610. people use a middle name as a regular form of address rather than their first given name
  1611. How can we accommodate this? It can be done by means of a User function. Use
  1612. functions are short program segments, written in BASIC and placed in a subdirector
  1613. UserFuncs inside the database. The actual writing of User functions is beyon
  1614. the scope of this series but a number of useful ones, including the one required here
  1615. will be found on the CD in the zip file Proceed as follows:
  1616. Close the !Names database
  1617. Shift-double-click on the !Names directory then open the UserFuncs subdirectory
  1618. Open the USERFUNCS zip file
  1619. Copy the BASIC file 'Name' into the database's UserFuncs subdirectory
  1620. Re-open the !Names database
  1621. Open the formula window and again delete up to the '='. If you now click th
  1622. User functions menu button you will see the name of the single installed use
  1623. function displayed as in Fig.5:
  1624.  
  1625.  
  1626.  
  1627. Fig.5 The User functions menu
  1628. This tells a BASIC programmer that the function FNUname takes three string variable
  1629. as parmaeters. These are supplied by the Surname, First name and Other names
  1630. fields respectively so what we actually need to put into the formula are the tag
  1631. of these fields. When you choose the user function from the menu it is entered int
  1632. the formula simply as 'FNUname()' and the caret is positioned between the parentheses
  1633. Enter SNAM,FNAM,MNAM (don't forget the commas!), select Recalculate existing records
  1634. and click OK. Make sure the window looks as it does in Fig.6 before doing so:
  1635.  
  1636.  
  1637. Fig.6 A formula using a User function
  1638. If you now browse through the records you will notice no difference in Address as fro
  1639. what was there already! Bring up a record in which at least one name has been entere
  1640. in Other names. (If there is more than one they must be separated by a space.) To mak
  1641. Address as use a name from this field place an asterisk immediately after the require
  1642. name. e.g. If John Smith's full name is John Philip Aloysius Smith and he prefers to b
  1643. called Philip, introduce an asterisk immediately after Philip in the Other names field
  1644. When you type Return Address as will change to 'Philip Smith'. If you'd placed th
  1645. asterisk after 'Aloysius' it would have become 'Aloysius Smith'. (Users with some knowledg
  1646. of programming in BASIC might like to examine how this simple user function works by loadin
  1647. the file 'Name' into their editor.)
  1648.  
  1649. Using subsidiary indexes
  1650. The only index we've encountered up to now is the primary key index; the one tha
  1651. every database must have in order to function at all. Powerbase allows you t
  1652. create subsidiary indexes to present the records in a different order. You can hav
  1653. up to 10 subsidiary indexes, which ought to be plenty for most users, but the number may b
  1654. increased if you wish by editing the file !Powerbase=>Resources=>Config. This is a text fil
  1655. which sets up many choices which need altering only rarely. The relevant item is the secon
  1656. one, with the token 'Keys' followed by a space and the number 10. Substitute a larger numbe
  1657. if necessary and re-save the file.
  1658. To create a subsidiary index click MENU over the field you want to index and choose Creat
  1659. index from the Field submenu. In order to be indexable a field must be some sort o
  1660. text field but needn't be an Editable one. You can, for example, index the Address as fiel
  1661. in the !Names database. The window which appears is the same as the one used to define the primar
  1662. key (Fig.7):
  1663.  
  1664.  
  1665. Fig.7 Indexing the Address as field
  1666. Note that the tag of the field over which you clicked MENU is already entered and the caret positione
  1667. in the Word icon. Pos contains 'L' (indicating that characters from the left-han
  1668. end of the chosen word will be used), and Chars contains the maximum length of the fiel
  1669. which is probably far more than you want.
  1670. Assuming you have the name in the form given-name-plus-surname you might decide to tak
  1671. the first three letters of each to construct the key. To do so set up the window as in Fig.8:
  1672.  
  1673.  
  1674. Fig.8 The new key structure entered
  1675. (Although you accessed this window by indicating that you wanted to index the Address as fiel
  1676. there is nothing to stop you defining a composite key using up to four fields, just as you can for th
  1677. primary key.) Click Create and, when the process concludes, you will see that the Address as
  1678. descriptor is now blue instead of black. This indicates that there is a key based on this field but i
  1679. isn't the currently-selected key. To change to the new key click the tool-pane button bearing the representatio
  1680. of a key. Address as changes to red, indicating that it is now the selected key, and Surname
  1681. becomes blue. If you have two or more subsidiary keys defined the 'key' button will cycle through them an
  1682. the primary key. ADJUST cycles through the keys in the opposite order to SELECT. Since there are only tw
  1683. keys here, using either mouse button simply alternates them.
  1684. With the new key selected you will find that browsing and reporting accesses the records in an orde
  1685. determined by this key instead of the primary key. To retrieve an individual record after clickin
  1686. the ? button you must now enter the appropriate subsidiary key in the Search window (Fig.9):
  1687.  
  1688.  
  1689. Fig.9 Searching on the new key
  1690. The name of the index containin
  1691. these keys is 'ADDR+ADDR' because it is made up from two parts of the field whose tag is ADDR
  1692. Note, however, that bump icons are provided to allow you to search for a record using a key other than the selected one without actuall
  1693. changing the selected key.
  1694. The Index entry on the main menu leads to a submenu from which you can inspec
  1695. the key-structure of the curent index, delete a subsidiary index (but not, of course, the primary key index!
  1696. and view the directory Indexes in which subsidiary indexes are stored. If you do delete an inde
  1697. it is removed from memory but not actually deleted from the disc. Instead the filename is prefixed wit
  1698. 'Del_' (and might also be truncated if your system can't use long filenames). You can revive a 'deleted
  1699. index by removing the prefix but you should only do so if no records have been added or deleted an
  1700. no field on which the subsidary index is based has been altered.
  1701. Subsidiary indexes can, in some circumstances, speed up report-creation. This can be particularl
  1702. noticeable in very large databases. The !Elements database in will serve to demonstrate the principle, although it isn't nearly big enough to show the benefits.
  1703. Create a subsidiary index on the Groupfield. It consists of only one 'word' so there's no nee
  1704. to enter anything under Word. Don't make the index case-specific
  1705. Don't make the new key the selected key: leave the primary key selected
  1706. Select Name (plus any other fields you care to include) for reporting
  1707. Make sure the Case specific button on the Match window is selected
  1708. Create a report using GP=T as a search formula. If you do this by clicking the Print
  1709. button on the Match window with ADJUST the window will remain open and indicate how long the report took
  1710.  
  1711. Note the displayed time in the Match window. Next,click Old to retrieve the same search formula
  1712. deselect the Case specific button on the Match window, and again click the Print
  1713. button with ADJUST. The displayed time should be less. On my 233 MHz RiscPC, with the first six field
  1714. selected the times are, respectively, 0.59 and 0.38 seconds. You may have spotted two other differences:
  1715. The report header in the first case says (as you'd expect) 'Ordered by: Primary key'. In the secon
  1716. case it says 'Ordered by: GP index', even though that wasn't the currently-selected index
  1717. The small square icon next to the writable icon in the Match window changed briefly to displa
  1718. the number '1' (the number of the GP index) when creating the second report
  1719.  
  1720. What's going on here, and why did deselecting Case specific make a difference? When Powerbase i
  1721. given a straightforward search formula of the type tag=target, i.e there is no 'OR' element involved
  1722. an 'all or nothing' match of field with target is demanded, it looks to see whether the field is indexed
  1723. If it is, all the keys which match the target will be together, one after the other, in the subsidiar
  1724. index and Powerbase can go straight to the beginning of this group of keys, ignoring all others which com
  1725. before or after. Relieved of the necessity of scanning the entire subfile for matching records, Powerbas
  1726. will complete the report more quickly but can only use this method if the case of the keys in th
  1727. index agrees with the one to be matched.
  1728. By default, keys in an index are non-case-specific. Whatever the case of the letters in the fields fro
  1729. which the key is constructed, they will be forced to uppercase in the key itself. This frees the user fro
  1730. the need to think about case when searching for a record by key: whatever you type in the Search window i
  1731. also forced to uppercase before comparing with the keys in the index. You can make keys case-specific (a
  1732. the time the index is created; not afterwards) but you would then need to type a key exactly matchin
  1733. the case of letters when retrieving a record. When generating reports, however, case is usually more importan
  1734. so the Case specific on the Match window is normally selected. To force Powerbase to use a subsidiar
  1735. index when creating a report you must set the Case specific switch on the Match window to be the same a
  1736. on the Key structure window; either both must be selected or both deselected. It would have been possible t
  1737. write Powerbase so that the button on the Match window was automatically set to agree with a subsidiar
  1738. index when Powerbase was about to use the latter, but I considered the disadvantages to outwiegh th
  1739. advantages. I'm willing to reconsider the matter, though, in the light of feedback from users.
  1740. Even in the example just demonstrated, where the targeted records amount to 30 out of 103, there i
  1741. a time difference. If you wanted a report targetting 30 records out of 10,000 there would be a very
  1742. dramatic difference.
  1743. Before leaving the subject of subsidiary indexes there are a couple more points worth making:
  1744. The primary key may not be null: at least one of the fields used in its construction must contain data
  1745. Subsidiary keys can, however, be null and it is often desirable to construct a subsidiary index on a fiel
  1746. which is blank in a large number of records. Under these circumstances it may be be advisable to select th
  1747. Omit null keys button before creating the index. Only those records which have data in at least one o
  1748. the key fields will then be included in the index
  1749. It is often useful to create a subsidiary index for just one purpose then delete it afterwards
  1750. In the previous article you could create subsidiary indexes on each of the three mark fields so that lists o
  1751. students could be printed in rank-order for each subject. It would actually be superfluous in this instanc
  1752. because a report in primary key order could be sorted on each mark column in turn, printing it out each time, but you'll get the idea
  1753.  
  1754. Attaching external files to database records
  1755. Textual and numeric data in 'ordinary' database fields is stored in a file called Database insid
  1756. the database's application directory. (It's a plain text file so you may load it into your favourite editor an
  1757. examine it.) There are other types of field which are linked to graphics or text files, by which w
  1758. mean a separate graphics or text file for each record. Because they aren't part of the Databas
  1759. file such fields are called External. There are, however, two levels of 'externalness'! Fields of th
  1760. following types have their individual graphics or text files stored in a special system of subdirectories insid
  1761. the database directory: they're 'external' to the Database file, but they do reside within the 'package' whic
  1762. makes up the database:
  1763. Text (Appears as a button on the record window with a small !Edit sprite
  1764. Sprite (Also appears as a button, but with a small !Paint sprite
  1765. Draw (Again, a button, but with a small !Draw sprite
  1766. Text block (The text, or part of it, is actually displayed in a large text icon
  1767. Picture (As above but the object is a sprite, actually displayed on the desktop
  1768. Unzip the example database works. If you drop a text file onto the Text button the sprite on the button changes from an Edit to 
  1769. text-file sprite. A similar thing happens when you drop a sprite file onto the Sprite button or a drawfil
  1770. onto the Draw button. You will also find that these buttons will only accept the appropriate type of file
  1771. dropping sprite file onto a Text button has no effect. Once a file is linked to a button you can click th
  1772. button to display the file in the appropriate editor (assuming the filer has 'seen' such an editor).
  1773. Dropping a text file onto the Text block icon displays the text, or as much of it as will fit. The limitation
  1774. imposed by RISC OS on multi-line text icons mean that the lines are always centred and the text is not directl
  1775. editable. Double-clicking over the icon will load the text into an editor and re-saving the text causes th
  1776. Text block to update; there's no need to drop the updated file on the icon again. Picture fields behave in 
  1777. similar way when sprites are dropped onto them but it is the user's responsibility to ensure that the ico
  1778. is big enough to contain the sprite, otherwise it will overflow onto the rest of the window.
  1779. Where are these 'external' files actually stored? Shift-double-click on the !Externals directory an
  1780. look inside. You will see a number of subdirectories with names like TBLKtext and TEXTtext
  1781. The first part of the name is the tag of the associated record field, the latter part tells us what typ
  1782. of file is stored. (NOTE: These directories won't be present until you have actually dropped an object o
  1783. the button or rectangle concerned.) Look inside one of these directories and you will find a subdirector
  1784. called '0', inside which is another subdirectory called '0'! Inside the latter will be one o
  1785. more Text, Sprite or Draw files called 'Rec0', 'Rec1' etc. indicating the record number with which the fil
  1786. is associated. This rather baffling directory structure arises from the 72-object directory limit on al
  1787. versions of RISC OS prior to 4.02. When the bottom level directory gets full a new one called '1' is create
  1788. in the level above. When that level becomes full of subdirectories one called '1' will be created immediatel
  1789. inside !Externals.TBLKtext or whatever.
  1790. Databases using External fields of the above types can become very large indeed - in actual disc size, no
  1791. just in number of records. They do have the advantage that you know where everything is: their chief disadvantag
  1792. is that, every time you drop a new file onto a field, you are making a copy of the original file. It would be nic
  1793. if we could use a database to classify files (especially graphics files) without copying or moving them
  1794. We can do this with the final type of External field - Remote. Our last exercise this month will be t
  1795. build a database which catalogues all the GIF files used as figures in this article.
  1796. We need only two fields: an Unrestricted field called something like 'Name' to act as the primary key fiel
  1797. and hold an identifier for the picture, and a Remote field to which we will give the tag 'GIF'. Add a descripto
  1798. if you wish but it isn't really necessary. The record window of the empty database will look something like this:
  1799.  
  1800.  
  1801. Fig.10 A blank record
  1802. Enter a brief description - 'Fig.1' will do - then drag the file 'fig1/gif' from the
  1803. HTML.POWERBASE.IMAGES directory and drop it on the large button
  1804. The down-pointing arrow will change to a GIF sprite:
  1805.  
  1806.  
  1807. Fig.9 A completed record
  1808. Create new records for the other GIFs in the same way. Clicking on the button will display the linke
  1809. file if the filer has seen an appplication capable of displaying GIFs. Everyone should have ChangeFSI whic
  1810. can do so. David Pilling's excellent ImgMaster will also display GIFs. Moreover, if you click the Remot
  1811. button with Ctrl-ADJUST and then browse through the records you will find that each image is displaye
  1812. automatically as you go from record to record. Another Ctrl-ADJUST click turns off the auto-display feature.
  1813. The files have not been moved or copied from their original location: all Powerbase is doing is storing the pathnam
  1814. of the file so that it can be found wherever it is on the disc. You can use this method to catalogue files in directorie
  1815. scattered all over your hard-disc, or over several hard-discs, and the files need not be of the same type. The butto
  1816. displays the appropriate sprite for the file type, e.g. a JPEG sprite for a JPEG file. Shift-ADJUST over the butto
  1817. displays the pathname of the linked file, but it might look rather odd because it is a relative pathname showin
  1818. where the file is in relation to the database. You can select the button with ADJUST to include the pathnames in a report
  1819. Well, that's all for this time. The main subjects of the next article will be mail-merging with Impression an
  1820. Ovation Pro, and how to use Powerbase's script language to automate common tasks.
  1821. Derek Haslam
  1822.  
  1823.  
  1824. ÿÿÿÿVOLUME3/ISSUE4/READARGS/INDEX.HTM Volume 3, Issue 4, OS_ReadArgs
  1825.  
  1826.  
  1827.  
  1828. OS_ReadArgs
  1829. A very useful OS call explained by Hariet Bazley
  1830. Reading options from the command line
  1831. A process rarely attempted by beginners
  1832. It is perhaps fair to say that in the RISC OS world, novice programmers rarely use the command line to pass data and/or options to their programs. Indeed, generalising from my own somewhat limited observations, I should say that the learning curve begins with single-tasking programs that request keyboard input:
  1833. What is your name
  1834. Hello, <name>!
  1835.  
  1836. and then proceeds, as the programmer begins to write 'useful' utility programs, to the use of global variables set up at the start of the code in order to supply data and control how it works:
  1837. in$="RAMDisc0.$.test"
  1838. debug%=TRUE
  1839.  
  1840. then followed by the first tentative steps into multitasking WIMP applications, with option icons and data files dragged to the window.
  1841. Only at the stage when the programmer is defining his own filetypes and double-clicking on them to load them into his program does he need to start worrying about reading data passed on the command line;  and even then it is more often than not a case of simply adding the magical characters %*0 into the !Run file of his application after the Run <App$Dir>.!RunImage, without necessarily understanding why.
  1842. Potential offered by the command line
  1843. In the GNU/Linux world, however, where just about everything can be done from the command line, with a graphical desktop very much an optional extra, this is not the case, and programs such as unzip or diff are designed to be invoked on the command line by name, followed by a long string of options: 
  1844. *GNUdiff <path1> <path2> -u -s -r -F^DEF -B -b
  1845. For many of us, this sort of thing may well have been our first encounter with the idea that data could be passed to a program other than simply by manipulating its icons!
  1846. However, while this sort of thing makes life difficult for the user (with the result that RISC OS versions of such programs rapidly acquire WIMP front ends) from a programmer's point of view it offers the considerable advantage that such programs can be run without any further input.   In other words, the program doesn't need to wait while the user sets up its options correctly and drags a file to its icon. It can be run from within another program, or as a command in an Obey or Desktop file, or as a task alarm.
  1847. RISC OS-specific facilities
  1848. In view of all this, it is surprising that the sophisticated SWI interface offered by RISC OS for parsing and interpreting command line options remains relatively little-known. Many people are aware of the use of OS_GetEnv (or the argv[] array in C) to read the contents of the command line used to invoke a program, but rather fewer have even heard of the SWI OS_ReadArgs, which will do almost all the hard work of interpreting the command line for you.
  1849. OS_ReadArgs will identify any number of keywords (options preceded by a dash) in a string passed to it, in any order, whether they are abbreviated to initial letters or supplied in full (-d, -debug), and copy any parameters following a given keyword (e.g. -infile "RAM:test") into a buffer supplied by the program. Pointers to the parameters will always be in a specified order within the buffer, no matter in which order they appear in the input string. Optionally, OS_ReadArgs will also evaluate parameters (e.g. "-bytes 12*1024" will supply the option bytes in the form of the numeric value 12288) or GSTrans them (e.g. "-init <Sys$Time>" would be translated to supply the current time as a parameter to the option init).
  1850. How it works — basic theory
  1851. OS_ReadArgs requires four values to be passed in, using registers R0-R4: the 
  1852. Syntax string
  1853. The most important (and difficult) part of using OS_ReadArgs lies in creating a suitable syntax string. This is where you specify what is and is not acceptable input; it also controls the order in which values will appear in the 
  1854. /S
  1855. Element is a switch, e.g. -u in the GNUDiff example above. This is like an option icon — either the option is on or it is off. If the keyword is present, then it is on; otherwise, it is assumed that the option is off. Note that this qualifier cannot sensibly be combined with any of the others, since the keyword is not followed by any parameter and the only way for a switch option to be off is for it not to be present
  1856. /A
  1857. This option must always be present, e.g. <path1> and <path2> for GNUDiff, where the program cannot function if not provided with the names of the two files to compare
  1858. /E
  1859. Values following this keyword will be evaluated (using the SWI OS_EvaluateExpression, which is equivalent to typing *eval on the command line). Typically, this qualifier is used to obtain a parameter as a numeric value rather than as a string by default
  1860.  
  1861. The case of the qualifiers is not important (capitals and lowercase letters may be mingled with impunity) but I have chosen to standardise on the use of capitals for the purposes of this article.
  1862. Input string
  1863. The input string will normally be obtained by calling OS_GetEnv, which returns the value of the program's command line, but may be any valid string. A sample command line used to invoke a BASIC program might read:
  1864. BASIC -quit "IDEFS::A5000.$.Director.!Styx.Hades.02-Sep-10.TestProg" -debug -input RAM:file1 -o <Test$Dir>.output -s 64
  1865. Output buffer
  1866. When the SWI returns, the output buffer will contain a series of 4-byte values, one for every element specified in the syntax string. They can be found in the order in which they appear in the syntax string irrespective of how the input string may have been arranged. Having the options in a predictable order obviously makes it much easier to write code to interpret them — one of the major advantages of using OS_ReadArgs!
  1867. In the case of a switch, any value other than zero will indicate that the keyword was present in the input string. In the case of all other options, a non-zero value in the relevant word of the output block can be interpreted as a pointer to the parameter which was associated with that keyword; a zero value indicates that the keyword was not used. Normally this will be a pointer to a zero-terminated string.
  1868. In the case of an evaluated parameter this word is instead a pointer to a five-byte block, where the first byte indicates the type of data in the block (a zero byte for integer data) and the next four bytes form the integer value itself. Beware — this data is not word-aligned!   BASIC will read a 32-bit value correctly from a non-word-aligned address, but for assembler (and by extension C) programs special coding will be required.
  1869. Note that the actual data supplied for any string or evaluated parameters will also be written to the output buffer, after the pointers — so it has to be big enough to cope with the maximum length of input you are expecting. If the buffer is not long enough for the input string provided, you will get a 'buffer overflow' error.
  1870. How it works — basic practice
  1871. The easiest way to explain how something works is by example.   All sample code will be given in BASIC, but the same principles apply to other languages.   
  1872. To illustrate the basics, I'll use a small program which doesn't actually read its own command line but simply passes a user-specified string to OS_ReadArgs — this will make it quicker and easier to test from the desktop! It will recognise four keywords, -debug, -width, -filename and -symbol. For the sake of argument I shall suppose that filename represents the name under which to save the output and must therefore always be supplied, that width is a integer value likewise required, that debug represents a switch which will activate debugging output if present, and that symbol may be one of either "square", "disc" or "triangle". I leave it to your imagination to come up with any useful function for this program...!
  1873. The syntax string required will thus contain four elements. The order in which they are specified is not important, save to determine the order in which the output pointers will appear in the block.
  1874. symbol will take a string parameter, if supplied this is the default element type, and therefore it requires no qualifier codes. Debug, as a switch, requires the /S code, and filename, which must always be supplied, requires an /A. This leaves width, which is both compulsory and numeric (evaluated) and therefore requires two qualifiers, /E/A.
  1875. The beginning of the program will thus read as follows:
  1876. DIM block% 25
  1877. syntax$="symbol,debug/S,filename/A,width/E/A"
  1878. INPUT "Enter test string",input$:REM ask for test data from use
  1879. SYS"OS_ReadArgs",syntax$,input$,block%,25
  1880.  
  1881. Acceptable input
  1882. Run this program, typing in a random test string when prompted. You will almost certainly get a 'Bad parameters' error. This is OS_ReadArgs warning you that the data it was given doesn't conform to the required syntax you specified — in other words, it's not in a form usable by your program!
  1883. Try a selection of different input strings (it's probably easier to set input$ directly each time by editing the third line of the program than to keep on typing strings in at the prompt).
  1884. You will find, for example, that "-symbol square -filename Test -width 19" and "-debug -filename Test -width 19" both work, but that "-symbol -filename Test -width 19" (because symbol requires a parameter) and "-symbol square -width 19" (because filename, defined as a non-optional keyword, has been omitted) will both result in an error.
  1885. Note also that while "-s square -f Test -d -w 19" is perfectly valid, "-sym square -file Test -de -widt 19" is not; keywords must be supplied either in full or as initial letters. For this reason, when defining names for your keywords it is a good idea to try to ensure that they all start with a different initial. If a single-letter option is supplied which will match more than one keyword, OS_ReadArgs will interpret it as matching the first keyword to appear in the syntax string — which may not be what was meant....
  1886. A slightly unexpected result can be obtained by supplying a string parameter to width, e.g. "-width two" — instead of 'Bad parameters', OS_ReadArgs will report 'Unknown operand'. This makes more sense when you remember that the /E qualifier, although almost invariably used to indicate numeric input, actually implies a *Eval operation. What is happening is that the parameter is being passed through OS_EvaluateExpression, and being interpreted there as a (non-existent) system variable. You can demonstrate this by opening a taskwindow and typing *Set two 6 or *SetEval two 6 — as far as RISC OS is concerned, you have just defined the value 'two' for the first time and the program will now be able to evaluate it!
  1887. Decoding the input
  1888. OS_ReadArgs would be of little use if all it did was check the validity of the input string; every time the SWI is successfully called, the 
  1889. Given that syntax$="symbol,debug/S,filename/A,width/E/A", the first word of the buffer in the example would be  defined as a pointer to a null-terminated string, the second word as a simple zero/non-zero value, the third word as another string pointer and the fourth as a pointer to an evaluated value block. Assuming the existence of a function FNzerostr() to read a zero-terminated string from memory (since in BASIC, CHR$(0) is not a string terminator but an ASCII code as valid as any other), the sample program can be extended after the call to OS_ReadArgs  as follows:
  1890. PRINT "symbol: " TAB(13)
  1891. IF block%!0 >0 THEN PRINT FNzerostr(block%!0) ELSE PRINT "<not used>"
  1892. PRINT "debug: " TAB(13)
  1893. IF block%!4 >0 THEN PRINT "on" ELSE PRINT "off"
  1894. PRINT "filename: " TAB(13)
  1895. PRINT FNzerostr(block%!8
  1896.  
  1897. If you test this you should find that the values supplied in input$ for these three keywords are reported as expected, and always in the same order no matter how the input is arranged. Note how there is no need to check for a zero pointer in the case of filename, since the latter has already been defined using the /A qualifier — this keyword can be guaranteed always to be present, since if it is missing OS_ReadArgs will already have reported it as an error.
  1898. Handling width is slightly more complicated. Again in this example I'm not checking for a zero pointer because this parameter has been defined as always present.
  1899. PRINT "width: "
  1900. eval_ptr%=block%!1
  1901. IF eval_ptr%?0 <>0 THE
  1902.  PRINT TAB(13);"<integer expected>"
  1903. ELS
  1904.  width%= (eval_ptr%?1)<<
  1905.  width%+=(eval_ptr%?2)<<
  1906.  width%+=(eval_ptr%?3)<<1
  1907.  width%+=(eval_ptr%?4)<<2
  1908.  PRINT width
  1909. ENDI
  1910.  
  1911. Note the complicated byte-by-byte memory access and shifting used in order to load a 32-bit value from an address that doesn't align with a 4-byte offset!  Strictly speaking, when accessing memory from BASIC this isn't actually necessary: width%=eval_ptr%!1 also produces the required result. I've included it to illustrate the technique required.
  1912. Specifying valid string input
  1913. You may remember that the initial specification for the test program stated that symbol could take one of only three parameters — "square", "disc" or "triangle". This was included as an example of a restriction that OS_ReadArgs can't handle for you! Anything on this level is up to the program itself to check, there is no way of specifying a permitted range of inputs.
  1914. CASE symbol$ O
  1915.    WHEN "square","disc","triangle":PRINT symbol
  1916.    OTHERWISE: PRINT "<invalid symbol type>"
  1917. ENDCAS
  1918.  
  1919. In this example, I've simply used a CASE... OF statement to detect anything that's not one of the three specific values.
  1920. Example program
  1921. Here's the final version of the demonstration program:
  1922. ON ERROR: ON ERROR OFF: PRINT REPORT$;" at line ";ERL:EN
  1923. DIM block% 25
  1924. syntax$="symbol,debug/S,filename/A,width/E/A"
  1925. input$="-s triangle -filename ADFS::0.$.Test -width 9 -d"
  1926. SYS"OS_ReadArgs",syntax$,input$,block%,25
  1927. PRINT "symbol: " TAB(13)
  1928. IF block%!0 >0 THE
  1929.  symbol$=FNzerostr(block%!0
  1930.  CASE symbol$ O
  1931.    WHEN "square","disc","triangle":PRINT symbol
  1932.    OTHERWISE: PRINT "<invalid symbol type>"
  1933.  ENDCAS
  1934. ELS
  1935.  PRINT"<not used>"
  1936. ENDI
  1937. PRINT "debug: " TAB(13)
  1938. IF block%!4 >0 THEN PRINT "on" ELSE PRINT "off"
  1939. PRINT "filename: " TAB(13)
  1940. PRINT FNzerostr(block%!8
  1941. PRINT "width: "
  1942. eval_ptr%=block%!1
  1943. IF eval_ptr%?0 <>0 THE
  1944.  PRINT TAB(13);"<integer expected>"
  1945. ELS
  1946.  width%= (eval_ptr%?1)<<
  1947.  width%+=(eval_ptr%?2)<<
  1948.  width%+=(eval_ptr%?3)<<1
  1949.  width%+=(eval_ptr%?4)<<2
  1950.  PRINT width
  1951. ENDI
  1952. EN
  1953. DEF FNzerostr(ptr%
  1954. LOCAL a
  1955. WHILE ptr%?a%:a%+=1:ENDWHIL
  1956. ptr%?a%=1
  1957. =$ptr
  1958.  
  1959. How it works — advanced theory
  1960. Alternative or missing keywords
  1961. In reality, the syntax string supplied to OS_ReadArgs can be somewhat more complex than my original description of it as a series of elements separated by commas, each consisting of a keyword followed by one or more qualifiers, where each element corresponds to a possible parameter in the command line. One important feature that I have so far ignored is the fact that an element can have more than one alternative keyword associated with it — or even none at all! The idea of using OS_ReadArgs to identify parameters not preceded by keywords might seem strange;  but in fact, any such 'unlabelled' parameters are simply assigned to the currently unused elements in order of occurrence, irrespective of whether they have keywords or not.
  1962. For example, in the case of our familiar syntax string "symbol,debug/S,filename/A,width/E/A" and the input"Test -w 9 -d triangle", the string "Test" would be assigned to the first unused keyword, symbol, the -w and -d elements would be identified as normal, and the string "triangle" would then go into the next vacant space under filename. As you can see, in order to ensure that strings go into the correct slots, you either have to provide keywords or else specify them in a predefined order which is a reasonable enough requirement.
  1963. It can happen that a keyword which is 'unused' at the time unlabelled input is encountered will subsequently occur towards the end of the input string — if, for instance, the example above had been written as "Test -w 9 -d -symbol triangle", the initial "Test" would have been assigned to the first vacant slot, under symbol, before the actual -symbol keyword was reached, and the confusing result would be an 'Argument repeated' error. If your input is at all likely to mix labelled and unlabelled elements, it is a good idea to ensure that even the labelled elements are arranged in the syntax string in the expected order.
  1964. It is possible, on the other hand, to provide more than one keyword for a given element. This has a purely cosmetic effect, and is done by separating the alternative keywords using the equals sign '='.   The syntax element "debug=errordump/S" allows the user to specify any of -d, -e, -debug or -errordump in order to activate this switch, according to preference. You can have more than two alternatives — even three or four — but you may find that you run out of spare initial letters for your other options!
  1965. Additional qualifiers
  1966. There are two further qualifiers which have not so far been mentioned, the most important of which is the /K option.
  1967. /K
  1968. Keyword must always be used, i.e. data not preceded by a keyword may never be placed in this element even if it is still currently 'unused'. Judicious use of this qualifier can avoid many of the problems above, at the cost of forcing input to be more verbose
  1969. /G
  1970. Data for this element will be GS_Trans'd. This allows you to pass strings containing control characters more easily, e.g. "<7>" or "|G" to represent CTRL-G, the system beep, and "|M" for a return character. The value of any system variables in the string will also be translated, e.g. <Wimp$ScrapDir> will be expanded to the full path of the current scrap directory
  1971.  
  1972. How it works - advanced practice
  1973. Reading the command line
  1974. In order to read the actual command line used to invoke your program from BASIC, the easiest way is to substitute a line:
  1975. SYS"OS_GetEnv" TO input$:PRINT input$
  1976. In place of the "input$=" line used for test purposes. Test this, and one small problem with the syntax string in the sample BASIC program I listed will rapidly become apparent — it doesn't actually work if you supply genuine input on the command line!
  1977. How to supply test dat
  1978. The easiest way to test command line input is to create an Obey (or TaskObey) file in the same directory as your test program, like this:
  1979. <Obey$Dir>.TestProg -debug -symbol square   -w 64
  1980. where 'TestProg' is the name of your BASIC file, and the options follow. If you then run this file, you will see that the command line received by your program not only includes the options you supplied, but also the filename of the program, together with the BASIC commands used to run your program! Given that the syntax string is suddenly being asked to cope with input like
  1981. BASIC -quit "IDEFS::A5000.$.Director.!Styx.Hades.02-Sep-17.TestProg" -debug -symbol square -f RAM:input -w 64
  1982. none of which it was expecting, and all of which occurs at the beginning of the input string, meaning that it gets assigned to the first available keywords, it is perhaps not surprising that the result is a plethora of 'Bad operand' (as a filename gets evaluated under width) or 'Bad parameters' errors.
  1983. Using 'dummy' elements to skip over unwanted parameter
  1984. In order to get OS_ReadArgs even to look at the options we are interested in, it is necessary to create 'dummy' elements that can be used by the SWI to parse the new data at the start of the line. The start of the program can be changed to look like this:
  1985. DIM block% 25
  1986. syntax$=",quit/S,progname,symbol/A,debug/S,filename/A,width/E/A"
  1987. SYS"OS_GetEnv" TO input$:PRINT input
  1988. SYS"OS_ReadArgs",syntax$,input$,block%,25
  1989.  
  1990. As you can see, I've added three new elements to the syntax string. The first one is a 'nameless' element with no qualifier codes either;  this is designed to pick up the "BASIC" which will always appear at the start of any BASIC program's command line. This isn't preceded by anything that OS_ReadArgs can interpret as a keyword, so it will be put in the first available slot, which I haven't bothered to name.
  1991. The second element is designed to catch the "-quit" option which follows the "BASIC" command; this is actually part of the definition for the filetype BASIC, meaning that when you double-click on a BASIC file you will be returned to the desktop once the program has finished, instead of being left at the BASIC ">" prompt in a command window. Technically it's a switch, since BASIC may or may not have been started with this option, so I've defined it as such in the syntax string. In practice, it is almost always certain to be present.
  1992. The third new element is designed to intercept the filename of the BASIC program. Here I've assigned it a named keyword in order to remind myself why this element is present, although strictly speaking, since a keyword will never be supplied for this element either, it has no more need of a name than the first element.
  1993. If you wanted to be sneaky and save a few bytes, you could even treat the "-quit" parameter immediately preceding this element as its keyword, and supply a syntax string along the lines of ",quit/K,symbol/A,debug/S,filename/A,width/E/A" (note the use here of the new qualifier /k to indicate that the keyword must always be present). However, since the "-quit" is logically attached to the "BASIC" rather than to the filename, I would suggest that this shortcut might result in some confusion.
  1994. Whichever you decide to do, it's a good idea to make a firm choice for one or the other, in order to minimise the infuriating next stage of altering your syntax string — which is...
  1995. Changing your block offset
  1996. The single most annoying thing about using OS_ReadArgs from BASIC is that every time you change the order of the elements in your syntax string, the order of the pointers in the output block will change. In the example program I gave, I was assuming that the data for the first keyword, symbol, was to be found at the start of the block, at offset block%!0. Adding three new elements to the start of the syntax string means that the data for this keyword has now been pushed back to block%!12 — and all the references to it need to be changed. So do all the references to subsequent keywords!
  1997. Reading GSTrans'd data
  1998. Just as a test of the new qualifier, I added a "VDU,/G" element to the end of the syntax string. Data returned by elements using the GSTrans qualifier is in neither the zero-terminated string nor the five-byte block but yet another format; since this is also the format used by OS_EvaluateExpression on the occasions when it calculates a string rather than a numeric value, it seemed worthwhile to create a subroutine for dealing with it.
  1999. The format is that of an unterminated string preceded by a two-byte length value;  the pointer for this element points to the start of the length bytes, so these have to be read first.
  2000. IF block%!28 THEN PRINT TAB(13) FNGS_Trans(block%!28
  2001. EN
  2002. DEF FNGS_Trans(ptr%
  2003. LOCAL len%,n%,a
  2004. len%=ptr%?0 + (ptr%?1 <<8
  2005. ptr%=ptr%+
  2006. REM length in first two byte
  2007. FOR n%=0 TO len%-
  2008.   a$+=CHR$(ptr%?n%
  2009. NEXT n
  2010. =a
  2011.  
  2012. The element VDU will now be GSTrans'd — you can test this by editing your command line to pass in system variables:
  2013. <Obey$Dir>.TestProg -VDU "Time: <Sys$Time>"  -symbol square -f RAM:input -w 64
  2014. or, if feeling really venturous, VDU codes — 
  2015. <Obey$Dir>.TestProg -VDU "<12> <17>,<6>"  -symbol square -f RAM:input -w 64
  2016. will clear the (command) window and change the text colour, though you'll probably have to use an Obey file rather than a TaskObey file to get the full effect!
  2017. Evaluated data — further dark corners
  2018. Coping with non-numeric values
  2019. You may remember that I stated that the data block for an element defined with the /E qualifier consists of five bytes; one byte to hold the value type and four (non-word-aligned!) bytes to point to the value itself. You may also remember that my sample program checked to see if the value type was zero, representing an integer, and rejected anything else as being unsuitable data. As it happens, neither of these are necessarily true.
  2020. It is in fact possible for OS_EvaluateExpression legitimately to return a string result, and I demonstrated this with the example of typing *Set two 6 to create a system variable <two> with a (string) value of "6"! Likewise, any other system variable will be expanded to produce a string result — and it is even possible to produce a sub-string result, with a command like *Eval (STR (78*62)) LEFT 2 (multiply 78 by 62, convert to a string, "4836", and return the first two characters from the left: "48"). Frankly, I doubt that anyone has used the *Eval command in this particular way since the days of RISC OS 2, but nevertheless the possibility remains.
  2021. If the first byte of the data block is non-zero, this signifies that the element was a string value. In this case, the following bytes do not constitute a pointer but consist of the string itself in GSTrans-type format — two length bytes followed by the unterminated string. Given the existence of a FNGS_Trans it is easy enough to cater for this possibility as well; simply substitute 
  2022. IF eval_ptr%?0 <>0 THE
  2023.  PRINT TAB(13);FNGS_Trans(eval_ptr%+1
  2024.  
  2025. for
  2026. IF eval_ptr%?0 <>0 THE
  2027.  PRINT TAB(13);"<integer expected>"
  2028.  
  2029. Non-integer value
  2030. It seems worth including a warning at this point that, unlike BASIC's VAL and EVAL commands, OS_EvaluateExpression (and by extension the /E qualifier to OS_ReadArgs) cannot handle non-integer values. Input containing a decimal point will simply lead to an 'unknown operand' error, expressions whose result would be fractional (22/7) are rounded down to the preceding integer.
  2031. If you are likely to need to pass fractions as arguments to your program, the best way to do so, from BASIC at least, is simply to pass them as string values and evaluate them from within the program.
  2032. frac$=FNzerostr(block%!24
  2033. fraction=VAL(frac$):REM note this is not an integer variable
  2034.  
  2035. Example program
  2036. Here is the updated version of the demonstration program, including new procedures and altered block offsets:
  2037. ON ERROR: ON ERROR OFF: PRINT REPORT$;" at line ";ERL:EN
  2038. DIM block% 25
  2039. syntax$=",quit/S,progname,symbol/A,debug/S,filename/A,width/E/A,VDU/G"
  2040. SYS"OS_GetEnv" TO input$:PRINT input
  2041. SYS"OS_ReadArgs",syntax$,input$,block%,25
  2042. PRINT "symbol: " TAB(13)
  2043. IF block%!12 >0 THE
  2044.  symbol$=FNzerostr(block%!12
  2045.  CASE symbol$ O
  2046.    WHEN "square","disc","triangle":PRINT symbol
  2047.    OTHERWISE: PRINT "<invalid symbol type>"
  2048.  ENDCAS
  2049. ELS
  2050.  PRINT"<not used>"
  2051. ENDI
  2052. PRINT "debug: " TAB(13)
  2053. IF block%!16 >0 THEN PRINT "on" ELSE PRINT "off"
  2054. PRINT "filename: " TAB(13)
  2055. PRINT FNzerostr(block%!20
  2056. PRINT "width: "
  2057. eval_ptr%=block%!2
  2058. IF eval_ptr%?0 <>0 THE
  2059.  PRINT TAB(13);FNGS_Trans(eval_ptr%+1
  2060. ELS
  2061.  width%= (eval_ptr%?1)<<
  2062.  width%+=(eval_ptr%?2)<<
  2063.  width%+=(eval_ptr%?3)<<1
  2064.  width%+=(eval_ptr%?4)<<2
  2065.  PRINT width
  2066. ENDI
  2067. IF block%!28 THEN PRINT TAB(13) FNGS_Trans(block%!28
  2068. EN
  2069. DEF FNzerostr(ptr%
  2070. LOCAL a
  2071. WHILE ptr%?a%:a%+=1:ENDWHIL
  2072. ptr%?a%=1
  2073. =$ptr
  2074.  
  2075. DEF FNGS_Trans(ptr%
  2076. LOCAL len%,n%,a
  2077. len%=ptr%?0 + (ptr%?1 <<8
  2078. ptr%=ptr%+
  2079. REM length in first two byte
  2080. FOR n%=0 TO len%-
  2081.   a$+=CHR$(ptr%?n%
  2082. NEXT n
  2083. =a
  2084.  
  2085. Error checking
  2086. Perhaps the most irritating thing about using OS_ReadArgs in a program is the infuriating error messages which appear if the input is not precisely as expected. For example, if the user innocently supplies "5.5" as a numerical (i.e. evaluated) argument, the SWI will instead report 'bad operand'!
  2087. So far, I have simply been allowing the SWI to generate error messages to stop the program if it cannot interpret its input.   However, this is not really desirable behaviour;  if you examine how UNIX-type command-line programs handle bad input, you will see that the norm is to respond by giving a summary of the correct syntax.
  2088. *sed -j Harrie
  2089. sed: illegal option -- 
  2090. Usage: sed [-nV] [--quiet] [--silent] [--version] [-e script
  2091.         [-f script-file] [--expression=script] [--file=script-file] [file...
  2092.  
  2093. X-SWIs
  2094. In order to be able to provide more helpful error messages, it is first necessary to suppress the automatic error generated by OS_ReadArgs itself.
  2095. Suppressing errors
  2096. To do this, simply prefix an X to the name of the SWI. Instead of causing an error which will halt the program, the SWI will signal that an error has occurred by setting the ARM processor's overflow flag. Methods of reading the processor flags will obviously differ according to how high-level the language is that you are using. From assembler you can check the overflow flag directly via the VS/VC (overflow set/overflow clear) condition codes;  from C, where SWIs are called via library functions, it is conventional for such functions to return a pointer to a error block in place of the normal NULL value in order to signal that an error has occurred.
  2097. BASIC uses a non-intuitive extension of the SYS "SWI_name" TO <variable> construction. If another variable is supplied after the end of the TO, separated by a semicolon, then all the processor flags will be copied into that variable. To read the overflow bit alone, mask it out with the binary value %1.
  2098. SYS"XOS_ReadArgs",syntax$,input$,block%,255 TO ;flags
  2099. error%=flags% AND %1
  2100.  
  2101. Causing your own error
  2102. You can then generate your own error report, using whatever text you prefer, using BASIC's ERROR <number>,<text> command. It is customary to use an error number of 255 to indicate a customised 'user' error. *Help Syntax will provide a summary of the expected syntax for describing the format for input on the command line.
  2103. IF error% THEN ERROR 255,"Syntax: TestProg -symbol "square"
  2104. |"disc"|"triangle" [-debug] -filename <
  2105. input file> -width <page width> [-VDU <VDU command>]"
  2106.  
  2107. Additional validity checks
  2108. If you want to be helpful to the user, you can also check for invalid data that can't be detected by the syntax string, such as numbers that are out of range, strings that don't match a restricted set of valid options (such as those for symbol above), unexpected string values from OS_EvaluateExpression, or filenames that don't exist.
  2109. The more checks you do on your input, the less likely your program is to fall over due to invalid data later on!
  2110. Harriet Bazley <harriet@bazley.freeuk.com>
  2111.  
  2112. ÿÿÿÿVOLUME3/ISSUE4/REPTON/INDEX.HTM Volume 3, Issue 4, Desktop Repton
  2113.  
  2114.  
  2115.  
  2116. Desktop Repton
  2117. Mat Thompson on the latest Repton Release
  2118. Repton, what can I possibly say about this game that hasn't already been said? Not a lot probably but I'll have a go anyway! This is a re-release of the recent Desktop Repton which lets you play Repton 3 in the desktop! This new version is based on that, but has a number of new features added, and the traditional CD album case has been replaced with a DVD style box.
  2119. A quick introduction, for those of you that may not have ever encountered Repton before, the object of the game is to collect all the diamonds on each screen, diamonds can be hidden in safes (key needed) and also in in spirit cages (Repton2 onwards) you can kill the monsters by dropping boulders on them and use the transporters to get to other parts of the screens, (Repton2 onwards) each level has a time limit and when all diamonds are collected (there is a map available to check where they are) you will be given a password to start at that level next time.
  2120. Upon loading Desktop Repton you are greeted with the following menu.
  2121.  
  2122. Choose which game you want to play by clicking on it and it will load into the iconbar, if you should require help click on the little help icon next to the game title. There is an HTML manual supplied with more in depth help for those that need it. If you want to install the game onto your hard-disc then all you do is drag the !DeskRep application to wherever you want it to go and it will copy it across and then it can be run from the hard-disc.
  2123. With the Repton icon on the iconbar you can click on 'Select' to start the game, or if you click on 'menu' there are a couple of game options - music and sound on and off and you can select either a CGA or VGA display and whether you want to play it in the desktop or normal out of desktop, and whether you want a big desktop window or a small desktop window, make your choices and click select on the Repton icon and away we go.
  2124. You should now see the main Repton screen, press space to start and its Repton 1 all over again, everything about it is identical from the original release, so if you could complete it once then you should be able to do it over again.
  2125.  
  2126. Repton 2 is again (from what I can see) an exact copy of the original, you still have to collect everything with 3 lives which in itself is quite a task, and I've still yet to finish this one so maybe I'll try it again now.
  2127.  
  2128. Finally we come to Repton3, which includes not just Repton 3, but Around The World in 40 Screens, Life Of Repton and Repton Thru Time, and of course the game editor you can edit the games screens & graphics using the editor, or create a whole new game.
  2129.  
  2130. So there you have it Repton 1, 2, 3, the extra screen levels and an editor, this is the ultimate Repton package! It would be pretty difficult to improve on this version, all the levels and tunes are the same as the originals, and as expected the graphics are improved and run much faster than the originals, try running Repton 1 in small desktop window and you'll see what I mean.
  2131. My only criticism is that while this is the best version of Repton that has been done, I have (and sure many others) have seen all these screens before so its not that much of a challenge to want to play through them again (particularly the really annoying ones) so I was hoping perhaps some new levels would have been included. There wasn't, but from what I have heard, Superior Software are now re-developing Repton for the PC (and for portable devices such as mobile phones -ED) and that the new levels that it has will be useable with Desktop Repton - so this sounds very promising indeed - anyone fancy converting Repton Infinity? Or how about a desktop Ego?
  2132. Desktop Repton is highly recommended as you get just about all the Repton games (minus  Infinity & Ego) all games work with RISC OS4 & Select 4.32/StrongARM, and with the prospect of new levels makes it hard to refuse - lets hope that it happens) - was it really 17 years ago when all this began?
  2133. Product details
  2134. Product:
  2135. Desktop Repto
  2136. Supplier:
  2137. APD
  2138. Price:
  2139. £19.90 (£10 as an upgrade from the first Repton CD
  2140. Address:
  2141. 39, Knighton Park Road, Sydenham, London, SE26 5R
  2142. Tel:
  2143. 020 8778 265
  2144. WWW:
  2145. E-mail:
  2146.  
  2147. Mat Thompson
  2148.  
  2149. ÿÿÿÿVOLUME3/ISSUE4/SDL/INDEX.HTM Volume 3, Issue 4, SDL for RISC OS
  2150.  
  2151.  
  2152.  
  2153.  
  2154. SDL for RISC OS
  2155. The full documentation for the EQ Labs SDL port
  2156. The latest version of this port can be obtained from the 
  2157. Introduction
  2158. This library is designed to make it easy to write games that run on Linux
  2159. Win32 and BeOS using the various native high-performance media interfaces
  2160. (for video, audio, etc) and presenting a single source-code level API t
  2161. your application.  This is a fairly low level API, but using this, completel
  2162. portable applications can be written with a great deal of flexibility.The library is loaded as a dynamically linked library on its nativ
  2163. platform, and is currently compiled natively for Linux, compiled fo
  2164. Win32 using a Linux hosted GC
  2165. cross-compilation
  2166. environment, and compiled using the EGCS C++ compiler under BeOS.An introduction to SDL can be found online at
  2167. http://www.libsdl.org/intro/
  2168. There are code examples on each of the main library pages, and there ar
  2169. fully fleshed example C++ classes and programs in the examples archive
  2170. available on th
  2171. SDL download page.For an introduction to basic multi-media programming concepts, you might tr
  2172. some of the following links
  2173. Game Programming LinksGame Developer Search EngineEnjoy!    Sam Lanting
  2174. <slouken@libsdl.org>
  2175. Table of Contents
  2176.  
  2177. RISCWorld
  2178.  
  2179.  
  2180.